@hexlet/

js_react_immutability_helper

ES6

No description

fork
loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
import update from 'immutability-helper';

const myData = {
  x: { y: { z: 5 } },
  a: { b: [1, 2] },
};

const newData = update(myData, {
  x: { y: { z: { $set: 7 } } },
  a: { b: { $push: [9] } }
});
console.log(newData)
// => { x: { y: { z: 7 } }, a: { b: [ 1, 2, 9 ] } }
Babel Compiler v6.4.4 Copyright (c) 2014-2015 Sebastian McKenzie