Skip to content

A simple hook that implements debouncing in React Apps

Notifications You must be signed in to change notification settings

pruthvi2103/use-debounce

Repository files navigation

use-debounce

A Small React hook that implements debouncing in react.

Install

npm i @pruthvi21/use-debounce

or

yarn add @pruthvi21/use-debounce

Usage

const someFunction= () => any
const delay = 1000 // delay in ms

const debouncedFunction= useDebounce(delay,someFunction)

debouncedFunction() // Calls it only once after the delay regardless of number of calls

What's Debouncing?

I'd suggest you go through this blog

Simpler TL;DR image explaination:

Image_Explaination

Note Package also published at github's registry

See packages section

npm install @pruthvi2103/use-debounce

About

A simple hook that implements debouncing in React Apps

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages