HTML5 Canvas Remove Event Listener by Name with Konva
To remove an event listener by name with Konva,
we can namespace the event type with the on()
method so that we can later
remove the event listener by the same namespace with the off()
method.
Instructions: Click on the circle to see two alerts triggered from two different onclick event bindings. Remove the event listeners using the buttons to the left, and again click on the circle to observe the new onclick bindings.
Note: vue and react don't support event namespacing, so we don't make a demo for them. We don't recommend using namespacing for Vue and React anyway.