Guest User

Untitled

a guest
Feb 24th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. return update(state, {
  2. [newestState.findIndex(list=>list.id===action.list)]: {
  3. entries: entries => update(
  4. entries, {
  5. $splice: [[entries.findIndex(item=>item.id===action.item),0]]
  6. }
  7. )
  8. }
  9. });
  10.  
  11. return update(state, {
  12. [newestState.findIndex(list=>list.id===action.list)]: {
  13. entries: entries => entries.filter(elem => elem.id != action.item )
  14. }
  15. });
Add Comment
Please, Sign In to add comment