Closed gerich-home closed 8 years ago
There should be an ability to write:
var a = itDepends.value(10); var b = itDepends.computed(function() { return a() > 30 ? 30 : a(); }); var subscription = b.onChange(function(newValue, oldValue) { console.log(oldValue + ' -> ' + newValue); }); a(20); // outputs 10 -> 20 a(30); // outputs 20 -> 30 a(40); // outputs nothing subscription.disable(); a(20); // outputs nothing subscription.enable(); a(10); // outputs 20 -> 10
There should be an ability to write: