- Preparing search index...
- The search index is not available
Ditox.js
- injectable<Tokens, Values, Result>(this: unknown, factory: ((...params: Values) => Result), ...tokens: Tokens): ((container: Container) => Result)
-
Type Parameters
-
Tokens extends (Token<unknown> | {
[key: string]: Token<unknown>;
})[]
-
Values extends { [ K in string | number | symbol]: Tokens[K] extends Token<V> ? V : Tokens[K] extends TokenProps<Props> ? Props : never }
-
Result
Parameters
-
this: unknown
-
factory: ((...params: Values) => Result)
-
- (...params: Values): Result
-
Returns Result
-
Rest
...tokens: Tokens
Returns ((container: Container) => Result)
-
- (container: Container): Result
-
Returns Result
Decorates a factory by passing resolved values as factory arguments.
If an argument is an object which has tokens as its properties, then returns an object containing resolved values as properties.
Returns
Decorated factory which takes a dependency container as a single argument.