Skip to content

Commit

Permalink
[Behavior Subject] small timing fix for first emitted value
Browse files Browse the repository at this point in the history
  • Loading branch information
chipweinberger committed May 2, 2023
1 parent cf67e68 commit 4699e90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class BehaviorSubject<T> {
}

void listen(Function(T) onData, {Function? onError, void Function()? onDone, bool? cancelOnError}) {
_controller.stream.listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError);
onData(latestValue);
_controller.stream.listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError);
}

Future<void> close() {
Expand Down

0 comments on commit 4699e90

Please sign in to comment.