JSPM

  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q32513F
  • License MIT

A debouncer library based on microtasks.

Package Exports

  • nexbounce

Readme

nexbounce

A debouncer library based on microtasks.

npm version npm downloads github issues license

Demo

You can try the demo here.

Installation

npm i nexbounce

Documentation

You can find documentation here.

Example

import { Nexbounce } from 'nexbounce';

let counter = 0;

const nexbounce = new Nexbounce();

nexbounce.enqueue(() => (counter += 3));
nexbounce.enqueue(() => (counter += 1));
nexbounce.enqueue(() => (counter += 2));

setTimeout(() => console.log(counter)); // 2