execution-engine
Version:
A TypeScript library for tracing and visualizing code execution workflows.
15 lines • 802 B
TypeScript
import { MemoizeOptions } from '../common/models/executionMemoization.model';
/**
* Decorator to memoize method executions and prevent redundant calls.
*
* @param onMemoizeEvent - Optional callback triggered after checking memory
* @param ttl - Small duration (in milliseconds) before clearing the stored result,
* capped at 1000ms to prevent excessive retention.
* @returns A method decorator for applying memoization.
*
* @remarks
* Uses `executeMemoize` internally to store and reuse results.
* A short delay (e.g., 100ms) ensures that multiple rapid calls can reuse the stored result.
*/
export declare function memoize<O>(onMemoizeEvent?: MemoizeOptions<O>['onMemoizeEvent'], ttl?: number): MethodDecorator;
//# sourceMappingURL=memoize.decorator.d.ts.map