Open
Description
From: canjs/canjs#1591
It's possible that events are dispatched that represent changes a component's init
function already knows about.
Putting this another way, in the following code:
init: function(){
// draw out DOM
},
"{scope} change": function(){
// update DOM
}
It's possible that "{scope} change" will be fired after init
, but it represents a change that init
already knew about.
With 2.2.3, you can work around this like:
init: function(){
can.batch.afterPreviousEvents(() => {
// draw out DOM
this.ready = true;
})
},
"{scope} change": function(){
if(this.ready = true) {
// update DOM
}
}
Instead, can.Component could only attach bindings "afterPreviousEvents" from the perspective of init.