@naturalcycles/js-lib
Version:
Standard library for universal (browser + Node.js) javascript
15 lines (14 loc) • 538 B
TypeScript
import type { AnyFunction } from '../types.js';
import type { MemoOptions } from './memo.decorator.js';
import type { MemoCache } from './memo.util.js';
export interface MemoizedFunction {
cache: MemoCache;
}
/**
* Only supports Sync functions.
* To support Async functions - use _memoFnAsync.
* Technically, you can use it with Async functions, but it'll return the Promise without awaiting it.
*
* @experimental
*/
export declare function _memoFn<FN extends AnyFunction>(fn: FN, opt?: MemoOptions<FN>): FN & MemoizedFunction;