A unique string Token which will correspond to the created Service.
A function with no arguments which returns the Service.
Create an Injectable function with dependencies (i.e. arguments).
Note: the list of dependencies must be readonly – that is, a literal tuple marked as const
. This tuple must
contain only string literals or string consts.
Ex:
const DependencyB = 'DependencyB'
const createMyService = Factory(
'MyService',
['DependencyA', DependencyB] as const,
(a: A, b: B) => { ... },
)
A unique string Token which will correspond to the created Service.
A readonly list of Tokens corresponding to dependencies (i.e. arguments to the Factory), which will be resolved by the Container to which this Factory is provided.
A function with arguments matching in type and length to the given list of dependencies. When called, it must return the Service.
Rest
...args: Tokens["length"] extends Params["length"]Generated using TypeDoc
Create an Injectable function with no dependencies (i.e. arguments).
Ex: