After 3 years redux coding, I turn to usie only useReducer + props without Context, that is the most simple solution. If I faced with complex problem, then change useReducer with useSagaReducer, without use any global state.
// simple combine reducer export const combineReducers = reducers => (state, action) => Object.entries(reducers).reduce( ( prevState, [key, reducer]) => { const subState = reducer(prevState[key], action); return prevState[key] === subState ? prevState : {...prevState, [key]:subState} ; } , state );
so i think good to know about redux, redux-saga and choose lightest state management for your app - depend complexity.
I had no idea of the useSagaReducer hook, pretty cool!
useSagaReducer
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
After 3 years redux coding, I turn to usie only useReducer + props without Context, that is the most simple solution. If I faced with complex problem, then change useReducer with useSagaReducer, without use any global state.
so i think good to know about redux, redux-saga and choose lightest state management for your app - depend complexity.
I had no idea of the
useSagaReducer
hook, pretty cool!