Closed caesaneer closed 2 years ago
It is to listen for events in your code.
See in the documentation: https://github.com/jerosoler/Drawflow#events
For example, when you delete a node, save to the database...
Ah, I understand now. on is not used by Drawflow directly and is provided as an API method that allows users to add listeners. All of the dispatch calls are "in-case" the user has added listeners.
Thanks for the expeditious response!
So you can extend the functionalities without modifying the library.
Example simple:
Example complex:
Hello,
As part of my evaluation of Drawflow I noticed the on method, which registers events. dispatch uses the events object to call events. Where are events actually registered? What I mean is, on does not appear to be called anywhere?
Thanks!