onChange property Null safety

Stream<St> onChange

A stream that emits the current state when it changes.


// Create the Store;
final store = new Store<int>(initialState: 0);

// Listen to the Store's onChange stream, and print the latest
// state to the console whenever the reducer produces a new state.
// Store StreamSubscription as a variable, so you can stop listening later.
final subscription = store.onChange.listen(print);

// Dispatch some actions, which prints the state.

// When you want to stop printing, cancel the subscription.


Stream<St> get onChange => _changeController.stream;