showing results for - "eact redux createslice or createreducer"
Kora
09 Feb 2017
1A good source of help is to read the Redux Toolkit docs, where it says:
2
3createSlice: A function that accepts an initial state, an object full of reducer functions, and a "slice name", and automatically generates action creators and action types that correspond to the reducers and state.
4
5createReducer: A utility that simplifies creating Redux reducer functions. It uses Immer internally to drastically simplify immutable update logic by writing "mutative" code in your reducers, and supports directly mapping specific action types to case reducer functions that will update the state when that action is dispatched.
6
7An important statement:
8
9==)====>Internally, createSlice uses createAction and createReducer, [...]