Closed mGhassen closed 5 years ago
It depends on the relationship of the data to your components.
class SumComponent extends Rete.Component {
constructor(onChange){
super("Number");
this.onChange = onChange;
}
worker(node, inputs, outputs) {
const sum = ...
this.onChange(sum);
}
}
const components = [new SumComponent(() => angularComponent.changeValue(...
engine.bind('workerdone');
engine.on('workerdone', ({ component, sum }) => ...);
//...
worker(node, inputs, outputs) {
const sum = ...
this.engine.trigger('workerdone', { component: this, sum });
}
engine.process(data, null, { onSum() { ... } })
// ...
worker(node, inputs, outputs, { onSum }) {
const sum = ...
onSum(sum);
}
Hello,
Thank you for this super project, i tried to start playing with the code with the angular one.
I'm using the basic example, and i wanted to send data of "SUM" from the worker to the angular component then to the new input in the html.
How can i do it. thank you very much