@f/raf-debounce

1.0.1 • Public • Published

raf-debounce

Build status Git tag NPM version Code style

Debounced raf (requestAnimationFrame) function

Installation

$ npm install @f/raf-debounce

Usage

var rafDebounce = require('@f/raf-debounce')
var debouncedRender = rafDebounce(render)

subscribe(debouncedRender)

API

rafDebounce(fn)

  • fn - The function you want to call no more than once every animation frame.

Returns: A debounced version of fn that runs only once every animation frame (at most). When called, that function returns a cancel function that can be used to cancel a pending debounce.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @f/raf-debounce

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • f