react addon update code example
Example 1: react addon update
const initialArray = [1, 2, 3];const newArray = update(initialArray, {$push: [4]}); // => [1, 2, 3, 4]
Example 2: react addon update
import update from 'react-addons-update'; const newData = update(myData, { x: {y: {z: {$set: 7}}}, a: {b: {$push: [9]}}});