Skip to content
Jonathan Eiten edited this page Jan 19, 2017 · 2 revisions

Here we will describe how events work in Hypergrid as well information on the feature chain

With Regards to Hypergrid.prototype.reset()

In events, Hypergrid.prototype.addEventListener keeps an internal list of events for the purpose of removing all events with a simple single call to Hypergrid.prototype.removeAllEventListeners, called on reset().

In addition, this addEventListener defines an optional 2nd param, internal, which if true causes the listener to be classified as “internal” which makes the listener invisible to removeAllEventListeners.

All the event listeners added in events.js are made internal in this way (by supplying true as 2nd parameter). This feature can be used by the app developer too but by way of illustration, I purposely did not make the listeners added in demo.js internal, but rather they are re-added after reset().