Open fedorinoGore opened 7 years ago
To perform a modification you can use setIn()
to achieve this:
bundles = Immutable.setIn(bundles, ["items", 0, "name"], "new name")
will give:
bundles: {
count: 12,
items: [ {
name: 'new name',
id: '213123123',
field: 'sdfdsf',
children: []
}, {}, {} ...]
}
Hi. Im just started to use this library and a little bit confused. At first look it has some powerfull tools - like replace, without, etc. But while trying to work with a real data model - I just cant figured out how to use those utilities for data model manipulations. For example. Very common task, I believe. Have a store with object bundles in it. Looks like
So I want to change some of the properties in one of the
bundle.items
array. How to do this smooth and beautifull using Immutable tooling without callinglodash
orunderscore
for help?