1.0.0 • Published 9 years ago

active-event-stack v1.0.0

Weekly downloads
2,281
License
MIT
Repository
github
Last release
9 years ago

Active Event Stack

This maintains one central stack, where each item is a series of event handlers. This stack allows multiple dialogs to overlap, but a keyboard action to only affect the top item.

Usage

var eventStack = require('active-event-stack');

// On mounting or creating an element, add a new listenable (a series of event listeners)
this.eventToken = eventStack.addListenable([
  ['click', this.clickHandler],
  ['keydown', this.keydownHandler]
]);

// On dismounting or removing an element, remove the listenable by its token
eventStack.removeListenable(this.eventToken);