1.0.6 • Published 11 months ago

basic-debouncer v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Basic Debouncer

The objective of this module is to make a very simple and lightweight debouncer. In case you are looking for something with more options my advise would one from lodash, debouncer or debounceify modules.

How to import

CommonJS

const debounce = require("debouncer");

ES6 module syntax

import debounce from "debouncer";

How to use

Method:

  • debounce(timeout, callback)

Examples

const debounce = require("debouncer");

let i = 0;
const callbackFunction = () => {
  i++;
};
for (let index = 5; index > 0; index--) {
  debounce(() => {
    callbackFunction();
    console.log(i);
  }, 10);
}

In this example 1 will be printed.

If no timeout is provided 200 will be picked by default

Status

npm bundle size

1.0.6

11 months ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago