Closed saalaus closed 5 years ago
Please specify your question in more detail
Worker have a inputs and outputs, as use outputs and outputs in code?
Readme contains an example https://github.com/retejs/code-plugin#code
I have inputs in empty
code(node, inputs, add) {
add('num', node.data.time)
console.log(inputs)
}
>>inputs:[undefined]
NumComponent does not have inputs
I use my component, my component have inputs
class Text extends Rete.Component {
constructor() {
super('Text');
}
builder(node) {
var prev = node.addInput(new Rete.Input('prev', "", anyType, false))
var next = node.addOutput(new Rete.Output('next', "", anyType, false))
}
code(node, inputs, add) {
add('name', "test")
console.log(inputs)
}
}
It looks like nothing is passed to this socket. Which node is connected before?
If node connecting before -> array [undefined], else -> array is empty (I connected 2 identical nodes)
1 node: input array empty
2 node: input array empty
1 node: input array empty
2 node: input array [undefined]
Does the left node has add('next', "some value")
in worker?
Why do inputs or undefined or air? As fill inputs?