# react-debounce-function

> React hook for debouncing functions.

Latest version **1.0.2** (published 2021-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-debounce-function
pnpm add react-debounce-function
yarn add react-debounce-function
bun add react-debounce-function
```

## 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.2 |
| Published | 2021-04-22 |
| First published | 2021-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 1.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Hasan Sefa Ozalp |
| Maintainers | hasansefaozalp |
| Keywords | react, react-hook, debounce |

## Links

- npm: https://www.npmjs.com/package/react-debounce-function
- Repository: https://github.com/Nases/react-debounce-function
- Homepage: https://github.com/Nases/react-debounce-function#readme
- Issues: https://github.com/Nases/react-debounce-function/issues
- npm.io page: https://npm.io/package/react-debounce-function

## Dependencies (2)

- [react](https://npm.io/package/react.md) *
- [lodash.debounce](https://npm.io/package/lodash.debounce.md) ^4.0.8

## 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.2 (latest) — 2021-04-22
- 1.0.1 — 2021-04-22
- 1.0.0 — 2021-04-21

## README

# react-debounce-function

## Install

```sh
npm i react-debounce-function
```

## Demo

A simple way to start playing around with react-debounce-function is with CodeSandbox:
https://codesandbox.io/s/react-debounce-function-njl0o

## Usage

### `useDebounce` is a hook for debouncing functions after a waiting time. 

```javascript
import { useDebounce } from 'react-debounce-function'

const MyComponent = () => {
  const sayHi = () => {
    console.log('Hi')
  }
  const [debouncedSayHi] = useDebounce(sayHi, 1000)

  return (
    // debouncedSayHi executes after 1000 milliseconds
    // only the latest call will be executed.
    <button onClick={debouncedSayHi}>say hi</button> 
  )
}

export default MyComponent
```

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