Created
July 13, 2020 14:57
-
-
Save bismitaguha/69afc65ed0639df158d8571e1f3837e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const listReducer = (state = initialState, action) => { | |
switch(action.type) { | |
case UPDATE_LIST: | |
return { | |
...state, | |
postobject: action.payload, | |
list: [...state.list.filter( | |
object => object.id !== action.payload.id | |
), action.payload] | |
}; | |
default: | |
return state | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment