August 2017
Beginner
374 pages
10h 41m
English
This works similar to how we insert items, except that we only create two slices and merge them together (with no item in-between). For the second slice, we skip one item after i to "delete" it:
const removeItem = (state = [], action) => { const i = action.index return [ ...state.slice(0, i) ...state.slice(i + 1) ]}
Read now
Unlock full access