Skip to content

Interface: ContainerConfig

Defined in: src/wirestate-core/container/container.ts:40

Defines one Container scope at construction time.

Remarks

Bind services and values here when they belong to the container from the start. Use validateContainerConfig when a framework adapter stores config before it creates the container.

Properties

activate?

ts
readonly optional activate?: boolean | readonly ServiceToken[];

Defined in: src/wirestate-core/container/container.ts:49

Controls which configured bindings are resolved during construction.

Remarks

Pass true to resolve every entry in bindings. Pass an array to resolve selected tokens from bindings. Omit it, or pass false, to keep services lazy.


bindings?

ts
readonly optional bindings?: readonly Binding[];

Defined in: src/wirestate-core/container/container.ts:59

Services or binding descriptors registered on this container.

Remarks

Bare service classes bind as singleton instance bindings keyed by the class itself. Descriptors can bind tokens to instances, factories, or values.


onError?

ts
readonly optional onError?: InternalErrorHandler;

Defined in: src/wirestate-core/container/container.ts:78

Handles isolated internal errors that Wirestate catches instead of rethrowing, such as event handler failures and lifecycle rejections.

Remarks

Child containers inherit the nearest parent handler when they do not provide their own.


parent?

ts
readonly optional parent?: Container;

Defined in: src/wirestate-core/container/container.ts:68

Parent container used for inherited bindings.

Remarks

A child checks its own bindings first, then walks the parent chain. Local bindings can replace parent bindings for the child scope.


plugins?

ts
readonly optional plugins?: readonly WirestatePlugin[];

Defined in: src/wirestate-core/container/container.ts:88

Plugins registered on this container.

Remarks

Own plugins may install bindings, such as message buses, during construction. Plugin lifecycle observers are effective for descendant containers through the parent chain.