Skip to content

Instantly share code, notes, and snippets.

@4knort
Created November 19, 2016 17:09
Show Gist options
  • Save 4knort/7fa57bb0169ee66caf71576bd8014478 to your computer and use it in GitHub Desktop.
Save 4knort/7fa57bb0169ee66caf71576bd8014478 to your computer and use it in GitHub Desktop.
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