@@ -35,17 +35,17 @@ void main() {
3535 final onStateChangeCompleter = new Completer <
3636 StoreChange <BaseCounter , BaseCounterBuilder , dynamic >>();
3737
38- final storeChagneHandler = createChangeHandler (onStateChangeCompleter);
39- storeChagneHandler .build (store);
40- // dipatch 2 different actions, since the handler is only set to listen to base.increment
38+ final storeChangeHandler = createChangeHandler (onStateChangeCompleter);
39+ storeChangeHandler .build (store);
40+ // dispatch 2 different actions, since the handler is only set to listen to base.increment
4141 // if both are handled by the handler the completer with throw an error
4242 store.actions.decrement (1 );
4343 store.actions.increment (4 );
4444
4545 final stateChange = await onStateChangeCompleter.future;
4646 expect (stateChange.prev.count, 0 );
4747 expect (stateChange.next.count, 4 );
48- storeChagneHandler .dispose ();
48+ storeChangeHandler .dispose ();
4949 });
5050
5151 test ('replaceState' , () async {
@@ -119,5 +119,16 @@ void main() {
119119 expect (stateChange.next.count, 3 );
120120 expect (stateChange.action.payload, 2 );
121121 });
122+
123+ test ('should not reset state and actions before closing' , () async {
124+ store
125+ .substateStream ((s) => s)
126+ .listen ((_) => expect (store.actions, isNotNull));
127+
128+ // intentionally don't wait
129+ store.dispose ();
130+
131+ store.actions.increment (1 );
132+ });
122133 });
123134}
0 commit comments