Skip to content

Function: validateContainerConfig()

ts
function validateContainerConfig(config: ContainerConfig): void;

Defined in: src/wirestate-core/container/container-config-validation.ts:34

Validates container construction config without creating a container.

Parameters

ParameterTypeDescription
configContainerConfigContainer configuration to validate.

Returns

void

Remarks

Use it in framework adapters or tests that accept ContainerConfig and want fast feedback before a Container is constructed. The same validation runs in the Container constructor.

Throws

WirestateError If onError is not a function.

Throws

WirestateError If activate references a token missing from bindings.

Example

typescript
import { Injectable, validateContainerConfig } from "@wirestate/core";

@Injectable()
class LoggerService {}

validateContainerConfig({
  bindings: [LoggerService],
});