How to synchronize multiple dataflows between component instances?

PreviousHow to replace a dependency when declaring a component instance?NextHow to handle the copyValue flag for non serializable instances?
Last updated

Last updated
...
/* 1. having a handler method which will perform the desired behavior only when everything needed is ready */
_processData: function() {
if (this.getData1() and this.getData2()) {
// Process data
var processedData = ...
//Set processedData slot
this.setProcessedData(processedData);
}
},
/* 2. calling this method every time the value of a slot, that need to be synchronized, changes; i.e. using the model\[SlotId\]Changed () */
modelData1Changed: function(newData) {
this._processData();
},
modelData2Changed: function(newData) {
this._processData();
},
...