toosoon-events
v3.0.0
Published
Project providing services implemented as singleton class instances
Downloads
24
Maintainers
Readme
TOOSOON EVENTS
Project providing services implemented as singleton class instances. They abstract and prevent the process of creating multiple event listeners for common browser events. These services are particularly useful for managing events that are likely to be listened to by many components.
Installation
Yarn:
$ yarn add toosoon-events
NPM:
$ npm install toosoon-events
Usage
import pointer, { Pointer } from 'toosoon-events/pointer';
function onPointerStart(pointers: Pointers[]) {
// ...
}
pointer.on('start', onPointerStart);
function dispose() {
pointer.off('start', onPointerStart);
}
Services
keyboard
pointer
raf
resize
scroll
License
MIT License, see LICENSE for details.