Skip to content

Instantly share code, notes, and snippets.

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