UNPKG

hta

Version:

The tiny framework for building Hyper Text Application with ease

10 lines (8 loc) 236 B
import { CALLBACK_HOOK, HOOKS, SCOPE } from "../core/types"; export default function useCallback(callback, deps) { return SCOPE.current.component[HOOKS].get( CALLBACK_HOOK, () => ({ result: () => callback }), deps ); }