Declaration
export function registerMultiInjectServices(
container: Container | ContainerModuleLoadOptions,
multiInjectToken: symbol,
services: readonly IMultiInjectService[],
): void;API Reference
Accepts an array of IMultiInjectService entries and registers them as one multi-injected list under multiInjectToken (injectable as an array). Each entry also maps token to target, so the same service can be resolved individually.
export function registerMultiInjectServices(
container: Container | ContainerModuleLoadOptions,
multiInjectToken: symbol,
services: readonly IMultiInjectService[],
): void;import { registerMultiInjectServices } from '@rs-x/core';import {
InjectionContainer,
RsXCoreInjectionTokens,
registerMultiInjectServices,
type IDeepClone,
type IMultiInjectService,
} from '@rs-x/core';
const services: IMultiInjectService[] = [
{ target: MyDomainDeepClone, token: Symbol.for('MyDomainDeepClone') },
{ target: MyFallbackDeepClone, token: Symbol.for('MyFallbackDeepClone') },
];
registerMultiInjectServices(
InjectionContainer,
RsXCoreInjectionTokens.IDeepCloneList,
services,
);
// injected as array by multiInject token
const list = InjectionContainer.getAll<IDeepClone>(
RsXCoreInjectionTokens.IDeepCloneList,DI container (or module load context) where services should be registered.
Multi-inject list token that receives the services.
Ordered list of service descriptors. This list is what gets injected as a single array through the multiInjectToken.
void