File size: 470 Bytes
f5071ca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import UserActionTypes from './user-types';
const INITIAL_STATE = {
currentUser: null,
hidden: true
}
const userReducer = (state = INITIAL_STATE, action) => {
switch(action.type) {
case UserActionTypes.SET_CURRENT_USER:
return {
...state,
currentUser: action.payload
};
case UserActionTypes.TOGGLE_HIDDEN_MENU:
return {
...state,
hidden: !state.hidden
};
default:
return state;
}
}
export default userReducer; |