Skip to content

useDebounceCallback ​

Category
Utilities

Hook that creates a debounced callback and returns a stable reference of it

typescript
import { useDebounceCallback } from '@elysiumorg/solid-use';

Usage ​

typescript
const [value, setValue] = createSignal(0);
const debouncedSetValue = useDebounceCallback(setValue, 500);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
callback(...args: Params) => Return-The callback function
delaynumber-The delay in milliseconds