0.1.4 • Published 6 years ago

@nielse63/debounce v0.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

@nielse63/debounce

Lightweight debounce function for node

Installation

Install with Yarn or npm

yarn add --dev @nielse63/debounce
npm install --save-dev @nielse63/debounce

Usage

const debounce = require('@nielse63/debounce');

const fn = () => {
  // some expensive function...
};

debounce(fn); // executed after 250ms

API

debounce(callback[, delay, immediate])

NameTypeDescriptionDefault
callbackFunctionCallback to execute after delayundefined
delayNumberDelay, in ms, before executing callback250
immediateBooleanWhether or not to run the function immediatelyfalse

Return Value

Function - The wrapper to execute the callback

Contributing

Development Setup

This project uses a monorepo setup that requires using Yarn because it relies on Yarn workspaces. Clone the repo and install the dependencies:

git clone https://github.com/nielse63/nielse63.git
cd nielse63
yarn

License

MIT © Erik Nielsen

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago