Function usePersistedReducer
- usePersistedReducer<R, T>(reducer, defaultState, key, initFunc?): [ReducerState<R>, Dispatch<ReducerAction<R>>]
Type Parameters
- R extends Reducer<any, any>
- T
Parameters
- reducer: R
- defaultState: T
- key: string
Optional
initFunc: ((arg) => ReducerState<R>)- (arg): ReducerState<R>
Returns ReducerState<R>
Returns [ReducerState<R>, Dispatch<ReducerAction<R>>]