Skip to content

Instantly share code, notes, and snippets.

@bismitaguha
Created July 13, 2020 14:46
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 bismitaguha/275f6c9e1e8309de047734fb804f6547 to your computer and use it in GitHub Desktop.
Save bismitaguha/275f6c9e1e8309de047734fb804f6547 to your computer and use it in GitHub Desktop.
const listReducer = (state = initialState, action) => {
switch(action.type) {
case POST_LIST:
return {
...state,
postobject: action.payload,
list: [...state.list, action.payload]
};
default:
return state
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment