# use-function-debouncer

> Exports a debounce(func, delay) function and a cancelDebounce function for debouncing in react apps

Latest version **2.0.0** (published 2019-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-function-debouncer
pnpm add use-function-debouncer
yarn add use-function-debouncer
bun add use-function-debouncer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-11-17 |
| First published | 2019-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andrew Jones |
| Maintainers | aej11a |

## Links

- npm: https://www.npmjs.com/package/use-function-debouncer
- Repository: https://github.com/aej11a/use-function-debouncer
- Homepage: https://github.com/aej11a/use-function-debouncer#readme
- Issues: https://github.com/aej11a/use-function-debouncer/issues
- npm.io page: https://npm.io/package/use-function-debouncer

## Recent versions

- 2.0.0 (latest) — 2019-11-17
- 1.0.1 — 2019-09-08
- 1.0.0 — 2019-09-08

## README

# useFunctionDebouncer

useFunctionDebouncer is a React hook which can *debounce* (or delay) a function and provide a method to cancel the function.

---

### What is debouncing?

*Debouncing* means delaying a function call.

&nbsp;
### How do I use it?

Use it like this:  
`const [debounce, cancelDebounce] = useFunctionDebouncer()`

Pass a _**function to debounce**_ and a _**time delay (in ms) to debounce it by**_ like this:  
`debounce(() => console.log("Debounce me!"), 1000)`

That will run `console.log(...)` after 1 second (1000 ms)

&nbsp;
### What else can I do?

If you'd like to _**cancel the function's execution during the debounce**_, run `cancelDebounce()`

---
_Source: https://npm.io/package/use-function-debouncer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
