Created
April 26, 2019 08:25
-
-
Save asherccohen/8f61589f41978953bd877c48d1195f7f 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
| const rootReducer = (state, action) => { | |
| // when a logout action is dispatched it will reset redux state | |
| if (action.type === 'USER_LOGGED_OUT') { | |
| const { users, comment } = state; | |
| state = { users, comment }; | |
| } | |
| if (action.type === 'USER_LOGGED_IN') { | |
| const { users, comment, orders } = state; | |
| state = { users, comment, orders }; | |
| } | |
| return appReducer(state, action); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment