1.0.1 • Published 3 years ago

tiny-pulsar v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

Tiny Pulsar

Build Status Dependency Status devDependency Status

Minimal footprint library that triggers a callback when the user scrolls or resizes the browser.

Get Started

npm install tiny-pulsar

API

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.