# use-debouncer-hook-react

> [![NPM version](https://badgen.net/npm/v/use-debounce-hooks)](https://www.npmjs.com/package/use-debouncer-hook-react)

Latest version **1.0.1** (published 2021-09-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install use-debouncer-hook-react
pnpm add use-debouncer-hook-react
yarn add use-debouncer-hook-react
bun add use-debouncer-hook-react
```

## 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 | 1.0.1 |
| Published | 2021-09-18 |
| First published | 2021-09-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mohammad Naderi |
| Maintainers | mhmd_ndri |
| Keywords | hook, react-hook, debouncer |

## Links

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

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-09-18
- 1.0.0 — 2021-09-16

## README

# use-debouncer-hook

[![NPM version](https://badgen.net/npm/v/use-debounce-hooks)](https://www.npmjs.com/package/use-debouncer-hook-react)

React custom hook

- useDebounce

## install

```sh
$ npm install use-debouncer-hook-react

```

## Demos

Here is a Demo of this hook that shows how it is working.
https://react-debouncer-hook.vercel.app/

### useDebouncer

When you want to run something after a certain delay you use this hook.

A `useDebouncer` is hook of update `state` after a certain time.

You can use it like the code below in your Projects
First arguments is a fanction that you want to run after a certain delay
Second arguments is our delay time.
And the third one is dependencies.

```js
import React, { useState } from "react";
import useDebouncer from "use-debouncer-hook-react";

function Component() {
  const [count, setCount] = useState(1);
  const delay = 1000;
  useDebouncer(() => alert(count), delay, [count]);
  return (
    <div className="App">
      <header className="App-header">
        <div>{count}</div>
        <button onClick={() => setCount((c) => c + 1)}>Increament</button>
      </header>
    </div>
  );
}
```

### NextJS

If you are using next js and you have problem with import the package you can import it dynamicly or check https://github.com/martpie/next-transpile-modules this repository to fix your

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