https://github.com/firstandthird/scroll-bus
https://github.com/firstandthird/scroll-bus
Last synced: 5 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 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T20:53:41.000Z (over 3 years ago)
- Last Synced: 2025-10-29T14:58:04.171Z (8 months ago)
- Language: JavaScript
- Size: 1.17 MB
- Stars: 1
- Watchers: 2
- 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();
```