SSE Hooks

useDebounceValue

GitHub
Custom hook that returns a debounced version of the provided value, along with a function to update it.

Installation

npx sse-hooks add use-debounce-value

Usage

example.ts
import { useDebounceValue } from "./{hooks file}";

const [debouncedValue, updateDebouncedValue] = useDebounceValue(
  inputValue,
  500,
  { leading: true },
);

API

Parameters

Prop Default Type
options-

UseDebounceValueOptions<T>

Optional configurations for the debouncing behavior.

initialValue-

T | () => T

The value to be debounced.

delay-

number

The delay in milliseconds before the value is updated (default is 500ms).

Returns

Return Value Default Type
[0]-

T

[1]-

DebouncedState<(value: T) => void>

Types Aliases

No specific type aliases defined for this component.

Changelog

c165d — feat: enhance useRoleGuard and useSSR hooks with additional options and documentation

30da4 — feat: add new hooks and their metadata

cf13e — feat: add custom hooks for step navigation, ternary dark mode, timeout, toggle, unmount, and window size

Built with Love • © 2026