SSE Hooks

useEventCallback

Custom hook that creates a memoized event callback.

Installation

npx sse-tool add use-event-callback

Usage

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

const handleClick = useEventCallback((event) => {
  // Handle the event here
});

API

Parameters

NameTypeDescription
fnFunctionThe callback function.

Return Value

Returns Function.

A memoized event callback function.

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