Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created August 26, 2019 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BetterProgramming/cc063e39127d70154eeab9ec6d4b0f4a to your computer and use it in GitHub Desktop.
Save BetterProgramming/cc063e39127d70154eeab9ec6d4b0f4a to your computer and use it in GitHub Desktop.
const SET_CONTACTS = 'SET_CONTACTS';
function contactsReducer(state, action) {
switch (action.type) {
case SET_CONTACTS:
state = action.payload;
return state;
default:
return state
}
}
export { contactsReducer, SET_CONTACTS };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment