Created
July 4, 2019 01:07
-
-
Save YKalashnikov/3243e8a0c5ef9bec1b5c059f648d45f0 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 initialState = { | |
currentUser: {} | |
} | |
export default function reducer(state = initialState, action) { | |
switch (action.type) { | |
case 'LOGIN_USER': | |
return {...state, currentUser: action.payload} | |
case 'LOGOUT_USER': | |
return {...state, currentUser: {} } | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment