c2-debounce-af

2.1.1 • Public • Published

debounce af

install

$ npm install c2-debounce-af

require

var daf = require("c2-debounce-af");

api

daf(fn) > debounced

creates a function which, when called, waits until there is no call until an animation frame is triggered. then executes fn with its the last arguments that has been passed to debounced.

example

var render = daf(function (text) {
    div.textContent = text;
});
 
input.addEventListener('input', function (eventObject) {
    render(eventObject.currentTarget.value)
});

Readme

Keywords

none

Package Sidebar

Install

npm i c2-debounce-af

Weekly Downloads

18

Version

2.1.1

License

MIT

Last publish

Collaborators

  • thec2group