DevToolsState<S>.fromApp constructor
DevToolsState<S>.fromApp (
- DevToolsState<
S> state, - DevToolsAction devToolsAction,
- List<
S> computedStates, - List stagedActions,
- Reducer<
S> appReducer,
Create a new instance of the DevToolsState using a normal application Action and Reducer.
Implementation
factory DevToolsState.fromApp(
DevToolsState<S> state,
DevToolsAction devToolsAction,
List<S> computedStates,
List<dynamic> stagedActions,
Reducer<S> appReducer,
) {
final newStates = <S>[...computedStates];
final newActions = <dynamic>[...stagedActions];
newStates.add(
appReducer(
state.currentAppState,
devToolsAction.appAction,
),
);
newActions.add(devToolsAction.appAction);
return DevToolsState<S>(newStates, newActions, newStates.length - 1);
}