From de21018a194ea46082ac20d95bf8e9debf3c946a Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Mon, 27 May 2024 17:38:12 +0200 Subject: [PATCH] feat: make toBehaviorSubject sync --- app_rx/test/helpers_test.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app_rx/test/helpers_test.dart b/app_rx/test/helpers_test.dart index 2849f15..bdcd3ec 100644 --- a/app_rx/test/helpers_test.dart +++ b/app_rx/test/helpers_test.dart @@ -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();