0.6.0 • Published 2 years ago

ts-event-handlers-lite v0.6.0

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

TS Event Handlers Lite

Dependencies: none (although AsyncEventListenerList constructor takes a runtime promise library parameter)

Events and event listener management is often integrated into frameworks like jquery, Ember, or Angular but sometimes you want to fire some framework agnostic events. If so, this library is here to help.

It includes event listener lists (synchronous and asynchronous), queue (buffer multiple events before firing them), and a singular event handler that waits for a single event before informing listeners and informing all subsequently attached listeners immediately (similar to jquery.ready(...)).

See the test directory for example usage of the functions in this project.

handlers

  • AsyncListenerList - handle a list of asynchronous event listeners and wait for each of them to complete when events are fired
  • ListenerList - a standard synchronous event listener list, when an event is fired, call each of the listeners and pass event failures to an option failure listener, also allows event addition/removal meta listeners
  • EventQueue - an event listener list which can queue up events and fire them in the order they were generated at a later time
  • events.d.ts - typescript interfaces and types
  • SingularEventHandler - an event listener list which waits for a single event and calls all listeners once when the event occurs, any listeners registered after the event occurs are invoked immediately
0.6.0

2 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

4 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago