# just-debounce-it

> return a debounced function

Latest version **3.2.0** (published 2022-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install just-debounce-it
pnpm add just-debounce-it
yarn add just-debounce-it
bun add just-debounce-it
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2022-12-17 |
| First published | 2017-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6200 |
| Author | Eric Nolte and Angus Croll |
| Maintainers | angus-c |
| Keywords | function, debounce, no-dependencies, just |

## Links

- npm: https://www.npmjs.com/package/just-debounce-it
- Repository: https://github.com/angus-c/just
- Homepage: https://github.com/angus-c/just#readme
- Issues: https://github.com/angus-c/just/issues
- npm.io page: https://npm.io/package/just-debounce-it

## Recent versions

- 3.2.0 (latest) — 2022-12-17
- 3.1.1 — 2022-08-08
- 3.1.0 — 2022-08-07
- 3.0.1 — 2021-11-13
- 3.0.0 — 2021-11-09
- 2.1.1 — 2021-11-01
- 2.1.0 — 2021-10-31
- 2.0.0 — 2021-10-22
- 1.5.0 — 2021-04-30
- 1.4.0 — 2021-04-12
- 1.3.1 — 2021-04-04
- 1.3.0 — 2021-04-04
- 1.1.0 — 2018-08-09
- 1.0.1 — 2017-05-28

## README

<!-- DO NOT EDIT THIS FILE! THIS FILE WAS AUTOGENERATED BY TEMPLATE-MATE -->
<!-- SEE https://github.com/angus-c/just/blob/master/CONTRIBUTING.md#readme-template -->

## just-debounce-it

Part of a [library](https://anguscroll.com/just) of zero-dependency npm modules that do just do one thing.
Guilt-free utilities for every occasion.

[`🍦 Try it`](https://anguscroll.com/just/just-debounce-it)

```shell
npm install just-debounce-it
```
```shell
yarn add just-debounce-it
```

Return a debounced function

```js
import debounce from "just-debounce-it";

const fn1 = debounce(() => console.log("Hello"), 500);
fn1();
fn1();
fn1();
// 500ms later logs 'hello' once

const fn2 = debounce(() => console.log("Hello"), 500, true);
fn2(); // logs hello immediately
fn2();
fn2();
// 500ms later logs 'hello' once

const fn3 = debounce(() => console.log("Hello"), 500);
fn3();
fn3();
fn3();
fn3.cancel();
// function cancelled before 'hello' is logged

const fn4 = debounce(() => console.log("Hello"), 500);
fn4();
fn4();
fn4();
fn4.flush();
// immediately invoke the debounced function
```

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