useEventCallback
Lifecycle & refsA stable callback that always sees the latest props and state
Install
$ npm install @usefy/use-event-callbackQuick start
useEventCallback.tsx
import { useEventCallback } from "@usefy/use-event-callback";
const onClick = useEventCallback(() => console.log(count));
// stable identity, always reads the current countAPI reference
useEventCallback<Args, R>(fn): (...args) => R — a referentially-stable function that proxies to the latest fn.
Go deeper
This page is the quick reference. For every example, prop, and edge case, read the full README — or open Storybook to change props live.