@zedux/atoms
Version:
A Molecular State Engine for React
12 lines (11 loc) • 425 B
TypeScript
import { InjectorDeps } from '../types/index';
/**
* Memoizes a callback function and wraps it in an `ecosystem.batch()` call.
*
* To memoize a callback without automatic batching, use `injectMemo` instead:
*
* ```ts
* injectMemo(() => myCallback, [])
* ```
*/
export declare const injectCallback: <Args extends any[] = [], Ret = any>(callback: (...args: Args) => Ret, deps?: InjectorDeps) => (...args: Args) => Ret;