Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.