redux-immer
is used to create an equivalent function of Redux combineReducers that works with immer
state.
Like redux-immutable
but for immer
Installation
Using npm:
$ npm install --save redux-immer
Features
- one time only produce
- standard-like reducers
- support react-router routerReducer integration (
redux-first-history
/react-router-redux
/connected-react-router
)
Usage
store.js
;;; // Reducers;; const store = ;
user.js
const initialState = id: null profile: {}; const user = { };
catalog.js
const initialState = ; const catalog = { };
Tips
You may call combineReducers
at any level of the reducer hierarchy. It doesn't have to happen at the top. In fact you may use it again to split the child reducers that get too complicated into independent grandchildren, and so on. (exact as original redux.combineReducer https://redux.js.org/api/combinereducers)
Feedback
Let me know what do you think!
Enjoy it? Star this project! :D
any idea? let me know and contribute!
Contributors
See Contributors.