Closed gerich-home closed 8 years ago
There should be an ability to write:
var a = itDepends.value(10); var b = itDepends.value(20); var c = itDepends.computed(function() { return a() + b(); }); var subscription = c.onChange(function(newValue, oldValue) { console.log(oldValue + ' -> ' + newValue); }); a(20); // outputs 30 -> 40 b(30); // outputs 40 -> 50 itDepends.bulkChange(function() { console.log('start'); a(30); b(40); console.log('a = ' + a()); console.log('b = ' + b()); console.log('end'); }); // outputs start, a = 30, b = 40, end, 50 -> 70 a(40); // outputs 70 -> 80 b(50); // outputs 80 -> 90
Described proposed feature as a test: https://github.com/gerich-home/it-depends/tree/bulk-change
There should be an ability to write: