You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CommandHooks are the way to process and modify incoming commands. However since they always return a single command a CommandHook cannot add additional commands to the chain.
Possible use cases:
A CreateNodeVariant command is processed and the node properties are translated. This would require adding an additional SetNodeProperties Command
A SetNodeProperties command is performed and a second SetNodeProperties command is created that translates the modified properties to other dimensions.
Possible Solution
A possible solution would be an onAfterHandle(): void method in the commandHookInterface. This method can be used to raise additional commands.
Alternatively the onBeforeHandle method could allow returning CommandInterface | Commands but that would come with quite some complexity as currently the results of each hook are passed to the next one.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this topic?
Description
CommandHooks are the way to process and modify incoming commands. However since they always return a single command a CommandHook cannot add additional commands to the chain.
Possible use cases:
CreateNodeVariant
command is processed and the node properties are translated. This would require adding an additionalSetNodeProperties
CommandSetNodeProperties
command is performed and a secondSetNodeProperties
command is created that translates the modified properties to other dimensions.Possible Solution
A possible solution would be an
onAfterHandle(): void
method in thecommandHookInterface
. This method can be used to raise additional commands.Alternatively the
onBeforeHandle
method could allow returningCommandInterface | Commands
but that would come with quite some complexity as currently the results of each hook are passed to the next one.The text was updated successfully, but these errors were encountered: