You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classTypedReducer<State, Action> implementsReducerClass<State> {
/// A [Reducer] function that only accepts an action of a specific typefinalStateFunction(State state, Action action) reducer;
/// Creates a reducer that will only be executed if the dispatched action /// matches the [Action] type.TypedReducer(this.reducer);
@overrideStatecall(State state, dynamic action) {
if (action isAction) {
returnreducer(state, action);
}
return state;
}
}
I prefer to extend TypedReducer instead pass function. It looks more convenient and by this reason I am using next version of TypedReducer:
Current TypedReducer looks:
I prefer to extend TypedReducer instead pass function. It looks more convenient and by this reason I am using next version of TypedReducer:
It doesn't make any conflict with current code and I think this version can be helpful for other users of this library.
The text was updated successfully, but these errors were encountered: