Marks a constructor dependency as optional: when the token has no provider,
the argument receives undefined instead of failing construction.
Used inside Inject, in the position of the argument it describes.
Optional means the dependency is absent, not that construction may
fail: a token that IS provided is resolved normally, and an error thrown
while building it — a circular dependency, a throwing factory — propagates
rather than being swallowed into undefined.
Honored identically on both construction paths: the DI container when one is
registered, and the kernel's service registry otherwise.
Parameters
token: string
The capability token to resolve when a provider exists
Marks a constructor dependency as optional: when the token has no provider, the argument receives
undefinedinstead of failing construction.Used inside
Inject, in the position of the argument it describes.Optionalmeans the dependency is absent, not that construction may fail: a token that IS provided is resolved normally, and an error thrown while building it — a circular dependency, a throwing factory — propagates rather than being swallowed intoundefined.Honored identically on both construction paths: the DI container when one is registered, and the kernel's service registry otherwise.