Overview
Caches function-call results to avoid unnecessary recomputation.
API Reference
Service for creating, checking, and reading cached call results by context object and function-call identity (function name + arguments).
export interface IFunctionCallResultCache {
create(
context: unknown,
result: IFunctionCallResult,
): IFunctionCallResultCacheEntry;
has(context: unknown, index: IFunctionCallIndex): boolean;
get(
context: unknown,
index: IFunctionCallIndex,
): IFunctionCallResultCacheEntry | undefined;
}import type { IFunctionCallResultCache } from '@rs-x/core';3 members in this interface.
create(
context: unknown,
result: IFunctionCallResult
): IFunctionCallResultCacheEntryParameters
| Name | Type | Required |
|---|---|---|
| context | unknown | required |
| result | IFunctionCallResult | required |
get(
context: unknown,
index: IFunctionCallIndex
): IFunctionCallResultCacheEntry | undefinedParameters
| Name | Type | Required |
|---|---|---|
| context | unknown | required |
| index | IFunctionCallIndex | required |
Returns
IFunctionCallResultCacheEntry | undefined
has(
context: unknown,
index: IFunctionCallIndex
): booleanParameters
| Name | Type | Required |
|---|---|---|
| context | unknown | required |
| index | IFunctionCallIndex | required |
Returns
boolean