Skip to content

Commit 771fb64

Browse files
authored
Update README.md
1 parent ed1b373 commit 771fb64

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@ var store = new Store<Counter, CounterBuilder, CounterActions>(
208208
middleware: [doubleMiddleware],
209209
);
210210
211-
store.stream.listen((_) => print(store.state.count));
211+
store.stream.listen((change) => print(change.next.count));
212212
213213
// The only way to mutate the internal state is to dispatch an action.
214214
store.actions.increment(1);
215-
// 1
216215
store.actions.doublerActions.increment(2);
217-
// 5
218216
store.actions.decrement(1);
217+
// 1
218+
// 5
219219
// 4
220220
```
221221

@@ -264,9 +264,9 @@ final countStream = store.substateStream<int>((BaseCounter state) => state.count
264264
countStream.listen((change) => print('prev: ${change.prev}, next: ${change.next}'));
265265
266266
store.actions.increment(1);
267-
// prev: 1, next: 2
268267
store.actions.nestedCounter.increment(2);
269-
// nothing logged
268+
269+
// prev: 1, next: 2
270270
271271
```
272272

0 commit comments

Comments
 (0)