Sha256: 88e540159fae002ef1517c39de16c87ef988ffee2879ca0d131c84465aa133fa
Contents?: true
Size: 505 Bytes
Versions: 15
Compression:
Stored size: 505 Bytes
Contents
export let eventHandlerMixin = Base => class extends Base { // idempotent event handling initialization initEventListener(eventName, eventHandler) { if (typeof this.eventsHandler === 'undefined') { this.eventsHandler = {}; } if (!this.eventsHandler[eventName]) { // Delegate to the component if possible this.eventsHandler[eventName] = eventHandler; this.element.addEventListener(eventName, eventHandler); } } };
Version data entries
15 entries across 15 versions & 1 rubygems