Skip to content

Commit 06ab8a2

Browse files
committed
close actionController before cancelling subscription
1 parent d079948 commit 06ab8a2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/src/store.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ class RxReduxStore<A, S> {
6262
bool Function(S previous, S next) equals,
6363
RxReduxLogger logger,
6464
}) {
65-
final actionSubject = StreamController<A>(sync: true);
65+
final actionController = StreamController<A>(sync: true);
6666
final actionOutputController = StreamController<A>.broadcast(sync: true);
6767

68-
final stateStream = actionSubject.stream
68+
final stateStream = actionController.stream
6969
.reduxStore<S>(
7070
initialStateSupplier: () => initialState,
7171
sideEffects: [
@@ -86,14 +86,14 @@ class RxReduxStore<A, S> {
8686
);
8787

8888
return RxReduxStore._(
89-
actionSubject.add,
89+
actionController.add,
9090
() => currentState,
9191
stateStream,
9292
actionOutputController.stream,
93-
() => Future.wait([
94-
actionSubject.close(),
95-
subscription.cancel(),
96-
]),
93+
() async {
94+
await actionController.close();
95+
await subscription.cancel();
96+
},
9797
);
9898
}
9999

0 commit comments

Comments
 (0)