wrapReduce method
You may wrap the reducer to allow for some pre or post-processing. For example, if you want to abort an async reducer if the state changed since when the reducer started:
Reducer<St> wrapReduce(Reducer<St> reduce) => () async {
var oldState = state;
AppState? newState = await reduce();
return identical(oldState, state) ? newState : null;
};
Implementation
Reducer<St> wrapReduce(Reducer<St> reduce) => reduce;