Skip to content

OptionalDependency · Core API

type OptionalDependency<T> = object;

A token wrapped as an optional dependency.

Optional dependencies resolve to undefined when no provider is registered in the container chain.

Type Parameter

T

readonly token: Token<T>;

Wrapped token whose provider may be absent.


readonly optional: true;

Marker used by the resolver to distinguish optional dependencies.