Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pruthvi2103/use-debounce
A simple hook that implements debouncing in React Apps
https://github.com/pruthvi2103/use-debounce
debounce hook javascript react typescript vite
Last synced: 3 months ago
JSON representation
A simple hook that implements debouncing in React Apps
- Host: GitHub
- URL: https://github.com/pruthvi2103/use-debounce
- Owner: pruthvi2103
- Created: 2022-03-18T06:43:34.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-18T10:49:05.000Z (almost 3 years ago)
- Last Synced: 2024-08-09T02:57:50.875Z (6 months ago)
- Topics: debounce, hook, javascript, react, typescript, vite
- Language: TypeScript
- Homepage:
- Size: 77.1 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# 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 msconst 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](https://levelup.gitconnected.com/debounce-in-javascript-improve-your-applications-performance-5b01855e086)
Simpler TL;DR image explaination:
![Image_Explaination](https://miro.medium.com/max/1400/1*-r8hP_iDBPrj-odjIZajzw.gif)
Note Package also published at github's registry
See packages section
`npm install @pruthvi2103/use-debounce`