retejs / module-plugin

4 stars 10 forks source link

Call module's original worker function for post processing (Preview).… #3

Closed JoelWAnna closed 5 years ago

JoelWAnna commented 5 years ago

Use case: showing a preview of the result of the module

  worker(node, inputs, outputs, args = {}) {
    if (args.silent) { return; }
    const previewControl = this.getPreviewControl(node.id);

    if (previewControl) previewControl.setValue(outputs[node.data.module]);
  }

Additionally Pass original args to module, use case of allowing state to be passed to inner module.

Ni55aN commented 5 years ago

https://www.npmjs.com/package/rete-module-plugin/v/0.3.0