Skip to content

Commit

Permalink
https://github.com/fluttercommunity/rx_command/issues/31
Browse files Browse the repository at this point in the history
  • Loading branch information
escamoteur committed Dec 3, 2019
1 parent a9675e0 commit 9d6d11f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rx_command_listener.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RxCommandListener<TParam, TResult> {
}
if (onIsBusy != null || onNotBusy != null) {
busySubscription = command.isExecuting.listen((isBusy) {
return isBusy ? this?.onIsBusy() : this?.onNotBusy();
return isBusy ? this.onIsBusy?.call() : this.onNotBusy?.call();
});
}
} else {
Expand All @@ -69,10 +69,10 @@ class RxCommandListener<TParam, TResult> {
busyChangeSubscription = command.isExecuting.debounceTime(debounceDuration).listen(onIsBusyChange);
}

if (onIsBusy != null && onNotBusy != null) {
if (onIsBusy != null || onNotBusy != null) {
busySubscription = command.isExecuting
.debounceTime(debounceDuration)
.listen((isBusy) => isBusy ? this?.onIsBusy : this.onNotBusy);
.listen((isBusy) => isBusy ? this.onIsBusy?.call() : this.onNotBusy?.call());
}
}
}
Expand Down

0 comments on commit 9d6d11f

Please sign in to comment.