Skip to content

Manage groups of event handlers so that only the last group can respond to events

License

Notifications You must be signed in to change notification settings

uberall/active-event-stack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Active Event Stack

npm

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);

About

Manage groups of event handlers so that only the last group can respond to events

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%