Overview
Array proxy factory and contracts that emit semantic index/mutation changes.
API Reference
Creates array proxies that emit index-scoped changes for array mutations.
import { ArrayProxyFactory } from '@rs-x/state-manager';import { InjectionContainer } from '@rs-x/core';
import {
RsXStateManagerInjectionTokens,
RsXStateManagerModule,
type IArrayProxyFactory,
} from '@rs-x/state-manager';
await InjectionContainer.load(RsXStateManagerModule);
// Resolve from DI container (do not construct this service directly).
const arrayProxy = InjectionContainer.get<IArrayProxyFactory>(
RsXStateManagerInjectionTokens.IArrayProxyFactory,
);
console.log(arrayProxy);import { Inject } from '@rs-x/core';
import {
RsXStateManagerInjectionTokens,
type IArrayProxyFactory,
} from '@rs-x/state-manager';
class MyConsumer {
constructor(
@Inject(RsXStateManagerInjectionTokens.IArrayProxyFactory)
private readonly dependency: IArrayProxyFactory,
) {}
}5 members in this class.
constructor( @Inject(RsXCoreInjectionTokens.IProxyRegistry) private readonly _proxyRegistry: IProxyRegistry)Parameters
| Name | Type | Required |
|---|---|---|
| _proxyRegistry | IProxyRegistry | required |
public override getId(data: IArrayProxyIdData): unknown[]Parameters
| Name | Type | Required |
|---|---|---|
| data | IArrayProxyIdData | required |
Returns
unknown[]
protected override createId(data: IArrayProxyIdData): unknown[]Parameters
| Name | Type | Required |
|---|---|---|
| data | IArrayProxyIdData | required |
Returns
unknown[]
protected override createInstance(
data: IArrayProxyData,
id: unknown[]
): IArrayObserverProxyPairParameters
| Name | Type | Required |
|---|---|---|
| data | IArrayProxyData | required |
| id | unknown[] | required |
Returns
protected override releaseInstance(
arrayObserverWithProxy: IArrayObserverProxyPair,
id: unknown[]
): voidParameters
| Name | Type | Required |
|---|---|---|
| arrayObserverWithProxy | IArrayObserverProxyPair | required |
| id | unknown[] | required |
Returns
void