change
Event fired when the value of the compute changes.
function(event, newVal, oldVal)
handler(event, newValue, oldValue)
Handlers registered on "change"
events will be called back as follows:
var age = compute(33);
age.on('change', function(ev, newVal, oldVal){
ev //-> {type: "change", batchNum: 5}
newVal //-> 34
oldVal //-> 33
});
age(34);
Parameters
- event
{Event}
:An event object.
- newVal
{*}
:The new value of the compute.
- oldVal
{*}
:The old value of the compute.