Create an Injectable factory function with dependencies (i.e. the factory function has arguments) that appends a Service onto an existing array of Services of the same type.
Ex:
import { myServiceFactory, MyService } from './my-service'
const createMyService = ConcatInjectable(
myServiceFactory.token,
['DependencyA', 'DependencyB'] as const,
(a: A, b: B): MyService => { return ... },
)
// Consumers then do:
const myConsumingServiceFactory = Injectable(
'myConsumingService',
[myServiceFactory.token] as const,
(myServices: MyService[]) => { return ... }
)
A string Token identifying an existing Service that has an Array type, to which will be appended the Service created by this factory function.
A readonly list of Tokens corresponding to dependencies (i.e. arguments to the Factory), which will be resolved by the Container to which this Injectable is provided.
A function with no arguments which returns the Service.
Generated using TypeDoc
Create an Injectable factory function without dependencies (i.e. the factory function has no arguments) that appends a Service onto an existing array of Services of the same type.
Ex: