Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lencioni/consolidated-events
Manage multiple event handlers using few event listeners
https://github.com/lencioni/consolidated-events
event-listener events javascript
Last synced: about 1 month ago
JSON representation
Manage multiple event handlers using few event listeners
- Host: GitHub
- URL: https://github.com/lencioni/consolidated-events
- Owner: lencioni
- License: mit
- Created: 2016-11-02T22:10:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-18T20:46:36.000Z (over 6 years ago)
- Last Synced: 2024-11-09T19:01:57.352Z (about 2 months ago)
- Topics: event-listener, events, javascript
- Language: JavaScript
- Size: 52.7 KB
- Stars: 44
- Watchers: 5
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# consolidated-events [![Version Badge][npm-version-svg]][package-url]
[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url][![npm badge][npm-badge-png]][package-url]
Manage multiple event handlers using few event listeners.
## Example
```js
import { addEventListener } from 'consolidated-events';const removeEventListener = addEventListener(
window,
'scroll',
() => { console.log('scrolling') },
{ passive: true }
);...
removeEventListener();
```[npm-version-svg]: http://versionbadg.es/lencioni/consolidated-events.svg
[package-url]: https://npmjs.org/package/consolidated-events
[travis-svg]: https://travis-ci.org/lencioni/consolidated-events.svg
[travis-url]: https://travis-ci.org/lencioni/consolidated-events
[deps-svg]: https://david-dm.org/lencioni/consolidated-events.svg
[deps-url]: https://david-dm.org/lencioni/consolidated-events
[dev-deps-svg]: https://david-dm.org/lencioni/consolidated-events/dev-status.svg
[dev-deps-url]: https://david-dm.org/lencioni/consolidated-events#info=devDependencies
[license-image]: http://img.shields.io/npm/l/consolidated-events.svg
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/consolidated-events.svg
[downloads-url]: http://npm-stat.com/charts.html?package=consolidated-events
[npm-badge-png]: https://nodei.co/npm/consolidated-events.png?downloads=true&stars=true