tiny-pulsar

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i tiny-pulsar

Weekly Downloads

8

Version

1.0.1

License

MIT

Unpacked Size

5.27 kB

Total Files

6

Last publish

Collaborators

  • grindcode