Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // array //
- // remove
- state.filter(element => element !== condition)
- // add
- [...state, element]
- // replace
- state.map(element > element === condition ? newElement : element)
- // Object //
- // remove
- {...state, key: undefined} // not ideal way
- _.omit(state, "key") // using lodash lib
- // add
- {...state, key: value}
- // replace
- {...state, key: value}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement