Import
import { MethodAccessor } from '@rs-x/core';API Reference
Method-call accessor implementation used by the index-value-accessor pipeline. It reads cached method-call results by function-call index; it does not execute methods directly.
import { MethodAccessor } from '@rs-x/core';import {
InjectionContainer,
RsXCoreInjectionTokens,
RsXCoreModule,
type IFunctionCallIndexFactory,
type IFunctionCallResultCache,
type IMethodAccessor,
} from '@rs-x/core';
await InjectionContainer.load(RsXCoreModule);
const accessor = InjectionContainer.get<IMethodAccessor>(
RsXCoreInjectionTokens.IMethodAccessor,
);
const indexFactory = InjectionContainer.get<IFunctionCallIndexFactory>(
RsXCoreInjectionTokens.IFunctionCallIndexFactory,
);
const resultCache = InjectionContainer.get<IFunctionCallResultCache>(
RsXCoreInjectionTokens.IFunctionCallResultCache,
);
const context = { sum: (a: number, b: number) => a + b };import { Inject, RsXCoreInjectionTokens, type IMethodAccessor } from '@rs-x/core';
class MyConsumer {
constructor(
@Inject(RsXCoreInjectionTokens.IMethodAccessor)
private readonly dependency: IMethodAccessor,
) {}
}7 members in this class.
constructor(
@Inject(RsXCoreInjectionTokens.IFunctionCallResultCache) private readonly _functionCallResultCache: IFunctionCallResultCache
)Parameters
public applies(
context: unknown,
index: IFunctionCallIndex
): booleanParameters
Returns
boolean
public getIndexes(): IterableIterator<IDisposableFunctionCallIndex>Parameters
No parameters.
Returns
IterableIterator<IDisposableFunctionCallIndex>
public getResolvedValue(
context: object,
index: IFunctionCallIndex
): unknownParameters
Returns
unknown
public getValue(
context: unknown,
index: IFunctionCallIndex
): unknownParameters
Returns
unknown
public hasValue(
context: object,
index: IFunctionCallIndex
): booleanParameters
Returns
boolean
public setValue(
_: object,
index: IFunctionCallIndex
): voidParameters
Returns
void