const { id } = payload const nextState = produce(state, draftState => { draftState.categories.forEach(category => { if (id === category.id) category.selected = !category.selected }) const { id, price } = payload const nextState = produce(state, draftState => { draftState.categories.forEach(category => { if (id === category.id) { category.price = price