Last active
February 25, 2020 00:43
-
-
Save csantiago132/0d2bc0b5e18fce613d70a6232f5ca42e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ... prev. code ommited | |
| export const combineReducer = (reducers) => { | |
| // ... prev. code ommited | |
| /** | |
| * Global reducer function; this is passed to the useReducer hook | |
| * | |
| * @param {object} state | |
| * @param {object} action | |
| */ | |
| const reducerFunction = (state, action) => { | |
| // used to compare prevState vs the one returned by the reducer | |
| let hasStateChanged = false; | |
| // updated state object to be returned | |
| const updatedStateByReducers = {}; | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment