Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/firstandthird/scroll-bus
https://github.com/firstandthird/scroll-bus
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/firstandthird/scroll-bus
- Owner: firstandthird
- License: mit
- Created: 2017-03-09T09:13:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T20:53:41.000Z (about 2 years ago)
- Last Synced: 2025-01-07T16:47:15.045Z (15 days 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
[![Build Status](https://travis-ci.org/firstandthird/scroll-bus.svg?branch=master)](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();
```