Last active
February 26, 2018 07:22
-
-
Save rohanBagchi/1bcc4ffd77d0816d93a2c59eea74ecf5 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 defaultState = { | |
| user: {} | |
| }; | |
| export default function reducer(state, action) { | |
| state = state || defaultState; | |
| const { type, payload } = action; | |
| switch (type) { | |
| case 'SET_USER_DETAILS': | |
| return { | |
| ...state, | |
| user: payload.user | |
| }; | |
| default: | |
| return state; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment