Skip to content

useDebounceEffect

Hook that runs an effect after a delay when dependencies change

utilities
high
test coverage
Last changed: last month

Installation

Library
CLI
Manual
typescript
import { useDebounceEffect } from '@siberiacancode/reactuse';

Usage

typescript
useDebounceEffect(() => console.log('effect'), 500, [value]);
## Demo

Api

Parameters

NameTypeDefaultNote
effectEffectCallback-The effect callback to run
delaynumber-The delay in milliseconds
depsDependencyList-The dependencies list for the effect

Type declaration

typescript
import type { DependencyList, EffectCallback } from 'react';

Source

SourceDemo

Contributors

D
debabin
debabin

Released under the MIT License.