Jonatas

add type to workers

... ... @@ -160,6 +160,16 @@ class RxBool extends _RxImpl<bool> {
RxBool([bool initial]) {
_value = initial;
}
bool operator &(bool other) => other && value;
bool operator |(bool other) => other || value;
bool operator ^(bool other) => !other == value;
String toString() {
return value ? "true" : "false";
}
}
class RxDouble extends _RxImpl<double> {
... ...
... ... @@ -3,7 +3,7 @@ import 'package:get/get.dart';
import '../rx_core/rx_interface.dart';
import 'utils/debouncer.dart';
Worker ever(RxInterface listener, Function(dynamic) callback,
Worker ever<T>(RxInterface<T> listener, Function(T) callback,
{bool condition = true}) {
StreamSubscription sub = listener.subject.stream.listen((event) {
if (condition) callback(event);
... ...