Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // require() some stuff from npm (like you were using browserify)
- // and then hit Rebuild to run it on the right
- var immstruct = require('immstruct');
- var structure = immstruct({foo: {bar: 'hello'}});
- //update the cursor
- structure.cursor('foo').update('bar', function () { return 'newbar' });
- //set new key in immutable data structure
- structure.cursor('foo').set('baz', 'foobaz');
- alert(JSON.stringify(structure.cursor('foo').toJSON()));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement