Closed agarwalishan closed 4 years ago
In your CustomNodeWidget
, you have access to the engine
. If you haven't, change your CustomNodeFactory
to pass this.engine
as a prop to your widget.
Now, you can call this.props.engine.fireEvent(event, 'myCustomListenerName')
, where event
is any object you want.
To listen to this event:
engine.registerListener({
myCustomListenerName: event => console.log('TODO: handle event', event),
})
@renato-bohler Thanks man you saved my life it worked perfectly.
Hey, can someone please tell me how can I make a custom event listener on my customNodeModel? I want this listener to fire when I right click on node.