Created
November 19, 2016 17:09
-
-
Save 4knort/7fa57bb0169ee66caf71576bd8014478 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
import { SET_USER, FIND_NAME } from '../constants/Constants'; | |
const initialState = { | |
activeUser: 0, | |
}; | |
export default function activeUser(state = initialState, action) { | |
switch (action.type) { | |
case SET_USER: | |
return { | |
...state, | |
activeUser: action.payload, | |
}; | |
case FIND_NAME: | |
return { | |
...state, | |
activeUser: 0, | |
}; | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment