Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
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.4.62/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.