░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
lon105.truehost.cloud
LOCATION:
/home/ilrtztmy/.trash/client/src/hooks
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: usePersistFn.ts
import { useRef } from "react"; type noop = (...args: any[]) => any; /** * usePersistFn instead of useCallback to reduce cognitive load */ export function usePersistFn<T extends noop>(fn: T) { const fnRef = useRef<T>(fn); fnRef.current = fn; const persistFn = useRef<T>(null); if (!persistFn.current) { persistFn.current = function (this: unknown, ...args) { return fnRef.current!.apply(this, args); } as T; } return persistFn.current!; }
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 useComposition.ts
TS
2.3 KB
2026-11-06 12:30
EDIT
📄 useMobile.tsx
TSX
584 B
2026-11-06 12:30
EDIT
📄 usePersistFn.ts
TS
471 B
2026-11-06 12:30
EDIT