0

I am using MindFusion library for Diagramming. For example, I have that listener:

diagram.addEventListener(Events.nodeCreating, function (sender, args) {

    diagram.removeEventListener(Events.nodeCreating, ????)

});

How can i remove it when my function is anonymous? It works when i will name it:

diagram.addEventListener(Events.nodeCreating, function tmp(sender, args) {

    diagram.removeEventListener(Events.nodeCreating, tmp)

});

but is there anyway to do it without forcing the name to that function? What should i put into "handler" parametr?

enter image description here

Brarord
  • 611
  • 5
  • 18
  • I don’t think you can if the handler is anonymous – evolutionxbox Jan 26 '20 at 02:38
  • 1
    Does this answer your question? [removeEventListener on anonymous functions in JavaScript](https://stackoverflow.com/questions/4950115/removeeventlistener-on-anonymous-functions-in-javascript) – evolutionxbox Jan 26 '20 at 02:40

0 Answers0