Skip to content

Commit

Permalink
feat: make toBehaviorSubject sync
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed May 27, 2024
1 parent f87bb80 commit de21018
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app_rx/test/helpers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ void main() {
expect(subject.value, 1);
}).unawait();

StreamSubscription? subscription1;
subscription1 = subject.listen((data) {
if (data == 1) {
subscription1?.cancel();
subscription1 = null;
}
});
subject.listen((data) {
if (data == 3) {
completer.complete();
}
});
await completer.future;
expect(subscription1, isNull);
expect(await subject.first, 3);
expect(subject.value, 3);
await subject.close();
Expand Down

0 comments on commit de21018

Please sign in to comment.