Created
February 19, 2019 01:15
-
-
Save rafael-metractive/e62a9184de67cde4aedc7f90d1563869 to your computer and use it in GitHub Desktop.
This file contains 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 USER_SET = 'USER_SET'; | |
const USER_SET_STATE = 'USER_SET_STATE'; | |
const initialState = { | |
user: {}, | |
loading: false | |
}; | |
export default (state = initialState, action = {}) => { | |
switch (action.type) { | |
case USER_SET: | |
return { ...state, user: action.data }; | |
case USER_SET_STATE: | |
return { ...state, loading: action.state }; | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment