I am working on a flux and am considering using immutable.js to maintain state. I saw that this reaction provides its own helper for updating immutable objects ( http://facebook.imtqy.com/react/docs/update.html ), but I could not say how much it differs from the immutable native methods setIn and updateIn ( i.e. I can already compare objects with === for se if they are changed using setIn). Is there a reason to use a response helper with immutable.js? Is it just syntactic sugar?
TL; DR:
var map = Immutable.fromJS({bar: 'baz'}); map2 = React.addons.update(map, { bar: {$set: 'foo'} });
differs from
var map = Immutable.fromJS({bar: 'baz'}); map2 = map.set('bar', 'foo');
javascript reactjs reactjs-flux
Fenster
source share