Documents injecute 1.x · Migrating from 0.x
Skip to content

Interface: RegistrationOptions<D, R> ​

Defined in: src/types.ts:146

Options for ServiceRegistry.addTransient.

Extended by ​

Type Parameters ​

D ​

D

R ​

R extends boolean = boolean

Properties ​

dependencies? ​

optional dependencies?: D

Defined in: src/types.ts:148

Dependency keys, passed to the factory in the same order.


replace? ​

optional replace?: R

Defined in: src/types.ts:161

Replace an existing registration of this key: one in the same container, or a parent's one in a fork (required there too). With replace: true the service's type becomes the new one (see Registered).

In a plain fork the replacement applies to services resolved in the fork: services registered in a parent keep the parent's instance. In an isolated fork it applies to every service resolved through the fork.

There must be something to replace: replace: true for a key that no container has throws INJECUTE_NOTHING_TO_REPLACE.

Released under the MIT License.