@three11/debounce
Version:
Debounce multiple function executions
50 lines (33 loc) • 1.5 kB
Markdown
[](https://github.com/three11/debounce/releases/latest)
[](https://github.com/three11/debounce/issues)
[](https://github.com/three11/debounce/commits/master)
[](https://travis-ci.org/three11/debounce)
[](https://www.npmjs.com/package/@three11/debounce)
[](https://www.npmjs.com/package/@three11/debounce)
[](https://github.com/three11/debounce/)
# Debounce
> Debounce multiple function executions
## Install
```sh
npm i @three11/debounce
```
or
```sh
yarn add @three11/debounce
```
## Usage
First, import the module:
```javascript
import debounce from '@three11/debounce';
```
Then use it to postpone a function's execution:
```javascript
debounce(yourAwesomeFn());
```
## Arguments
`debounce(fn, wait, immediate)` accepts three arguments:
- `fn` : the function to debounce
- `wait` : miliseconds to wait before running the `fn` again
- `immediate` : whether the function should run immediately
## License
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007