seamless-immutable

Remove element from nested redux state

独自空忆成欢 提交于 2019-11-28 13:01:28
I want to remove a element from my redux state. Im using seamless-immutable and its API to operate on the state. But I couldn't find any nice looking way to delete a element when the state is nested. So the element I want to delete is: state.shoppingcartReducer.products[articleNr] Thanks! import Immutable from 'seamless-immutable' import { addToShoppingcart, createShoppingCart } from '../actions/shoppingcartActions' const CREATE_SHOPPING_CART = 'CREATE_SHOPPING_CART' const ADD_PRODUCT = 'ADD_PRODUCT' const DELETE_PRODUCT = 'DELETE_PRODUCT' const UPDATE_QUANTITY = 'UPDATE_QUANTITY' const

Remove element from nested redux state

落花浮王杯 提交于 2019-11-27 07:37:41
问题 I want to remove a element from my redux state. Im using seamless-immutable and its API to operate on the state. But I couldn't find any nice looking way to delete a element when the state is nested. So the element I want to delete is: state.shoppingcartReducer.products[articleNr] Thanks! import Immutable from 'seamless-immutable' import { addToShoppingcart, createShoppingCart } from '../actions/shoppingcartActions' const CREATE_SHOPPING_CART = 'CREATE_SHOPPING_CART' const ADD_PRODUCT = 'ADD