Handlers aren't presently allowed to add and remove nodes, since the only way to do that at present is via the public API, use of which hampers composability. Instead, if the parts of the public API used to add and remove nodes could optionally be mapped to a handler's properties, this would allow handlers to affect node cardinality yet remain composable.
Suppose, for example, we could add a handler using this notation:
In this way, the node.exists(), node.create(), node.dispose() & nodes.removeNode() methods can all effectively be made available to handlers by referring to @exists in either input or output properties.
Similarly, @length could be used to make nodes.length() available, and @additions could be used to make nodes.addNode() available, where @additions can be passed an array of indices where new nodes will be created.
@james-shaw-turner, although this can implemented after an initial release, I think this is a nice feature you should be aware of as it will enable all re-usable functionality to be expressed using handlers.
Handlers aren't presently allowed to add and remove nodes, since the only way to do that at present is via the public API, use of which hampers composability. Instead, if the parts of the public API used to add and remove nodes could optionally be mapped to a handler's properties, this would allow handlers to affect node cardinality yet remain composable.
Suppose, for example, we could add a handler using this notation:
In this way, the
node.exists()
,node.create()
,node.dispose()
&nodes.removeNode()
methods can all effectively be made available to handlers by referring to@exists
in either input or output properties.Similarly,
@length
could be used to makenodes.length()
available, and@additions
could be used to makenodes.addNode()
available, where@additions
can be passed an array of indices where new nodes will be created.