SSE Hooks

useDebounceValue

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

Installation

npx sse-tool add use-debounce-value

Usage

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

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

API

Parameters

| Name | Type | Description | | :----------- | :------------------------ | :------------------------------------------------------------------------ | -------------------------- | | initialValue | T | Function | The value to be debounced. | | delay | number | The delay in milliseconds before the value is updated (default is 500ms). | | options | UseDebounceValueOptions | Optional configurations for the debouncing behavior. |

Return Value

Returns any.

An array containing the debounced value and the function to update it.

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