Update nodes dynamically based on connection

sure.. thanks

Conventionally, one would use msg.topic to identify which is which.

1 Like

@Colin, thanks for the suggestion.
Based on connection, I want to identify if an operand node acts as LHS or RHS node to subtraction node. An operand node can act as LHS to one subtraction node and RHS for other subtraction node and so on.
I was not able to achieve this with msg.topic.. Hope I haven't missed anything.

Potentially....
Don't re-evaluate the same msg, Example :

msg is an object - therefore is pass-by-ref

/ * Bad */
msg.topic = 1
self.send(msg)
msg.topic = 2
self.send(msg)

keep it to 2 outputs, and derive a message using properties from msg

let A = {
   ...msg,
}
A.topic = 1

let B = {
  ...msg,
}
B.topic = 2

self.send([A,B])

I think doing ...msg should yield 2 different objects (but I could be wrong)

1 Like

@marcus-j-davies
Got it. Thanks.

1 Like