Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/deps/usehooks-ts.ts>useEventCallback

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
function useEventCallback
import { useEventCallback } from "https://deno.land/x/netzo@0.5.63/deps/usehooks-ts.ts";

A hook for creating a memoized event callback.

Examples

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

Type Parameters

Args extends unknown[]
  • An array of argument types for the event callback.
R
  • The return type of the event callback.

Parameters

fn: (...args: Args) => R
  • The callback function.

Returns

(...args: Args) => R

A memoized event callback function.