Minimal footprint library that triggers a callback when the user scrolls or resizes the browser.
npm install tiny-pulsar
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 all callbacks registered with the same namespace.
namespace
: Callback namespace. (String)
import { register, deregister } from 'tiny-pulsar'
register('this is a namespace', function () {
// → your code goes here
deregister('this is a namespace')
})
See the License file.