https://github.com/firstandthird/scroll-bus
https://github.com/firstandthird/scroll-bus
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/firstandthird/scroll-bus
- Owner: firstandthird
- License: mit
- Created: 2017-03-09T09:13:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T20:53:41.000Z (over 2 years ago)
- Last Synced: 2025-03-04T09:40:27.529Z (4 months ago)
- Language: JavaScript
- Size: 1.17 MB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scroll Bus
[](https://travis-ci.org/firstandthird/scroll-bus)
Tiny library to centralize scroll handlers.
```javascript
import ScrollBus from 'scroll-bus';ScrollBus.on(event => {
// Do stuff
});// Debounced
ScrollBus.on(event => {
// Do stuff
}, 150);// Debounced and immediate
ScrollBus.on(event => {
// Do stuff
}, 150, true);// Removes handler
ScrollBus.off(handler);// Removes all handlers
ScrollBus.off();
```