Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Latest commit

 

History

History
38 lines (24 loc) · 1.02 KB

README.md

File metadata and controls

38 lines (24 loc) · 1.02 KB

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 { Debouncer } from 'nexbounce/nexbounce.js';

let counter = 0;

const debouncer = new Debouncer();

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

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