A wrapper around set to store the map. The map can be an instance of Lazy so that it is computed every time SetAction#act is called.
import { SetAction } from 'apption'let obj1 = { a: 1, b: 2, c: 3 }, obj2 = { a: 1, b: 2, c: 3 };const action = new SetAction({ a: [obj1], b: [obj2], c: [obj1] });action.act(20);console.log(obj1); // { a: 20, b: 2, c: 20}console.log(obj2); // { a: 1, b: 20, c: 3} Copy
import { SetAction } from 'apption'let obj1 = { a: 1, b: 2, c: 3 }, obj2 = { a: 1, b: 2, c: 3 };const action = new SetAction({ a: [obj1], b: [obj2], c: [obj1] });action.act(20);console.log(obj1); // { a: 20, b: 2, c: 20}console.log(obj2); // { a: 1, b: 20, c: 3}
The function equivalent of this action.
Rest
A wrapper around set to store the map. The map can be an instance of Lazy so that it is computed every time SetAction#act is called.
Example