1.0.1 • Published 5 years ago
tiny-pulsar v1.0.1
Tiny Pulsar
Minimal footprint library that triggers a callback when the user scrolls or resizes the browser.
Get Started
npm install tiny-pulsarAPI
register(namespace, callback)
Register a callback to be fired. Registration is accumulative and namespace is not unique.
namespace: Callback namespace. (String)callback: Function to be fired. (Function)
deregister(namespace)
Deregister all callbacks registered with the same namespace.
namespace: Callback namespace. (String)
Usage
import { register, deregister } from 'tiny-pulsar'
register('this is a namespace', function () {
// → your code goes here
deregister('this is a namespace')
})License
See the License file.