Skip to content

DI Bag API / index / ContextualFactory

Type Alias: ContextualFactory<F extends (this: void, dependencies: never, factoryContext: never) => unknown> ​

ts
type ContextualFactory<F extends (this: void, dependencies: never, factoryContext: never) => unknown> = (this: void, dependencies: Parameters<F> extends [] ? {} : Parameters<F>[0]) => ReturnType<F>;

Defined in: acquisition-context.ts:46

The named-dependency factory contract retained by an acquisition-context callback.

Type Parameters ​

Type ParameterDescription
FThe contextual callback whose named dependencies and return type are retained.

Parameters ​

ParameterDescription
this-
dependencies-

See ​

https://dany-fedorov.github.io/di-bag/guides/tutorial.html#make-selected-services-ready

Ordinary services. Checked composition. Explicit ownership.