Skip to content

Interface: ValueBindingDescriptor<T> ​

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

Describes a token-bound value stored directly in the container.

Remarks ​

Use a value binding for constants, configuration, already-created objects, environment data, or external objects that Wirestate should resolve as-is. Value bindings are always singletons. They are cached as the provided value and are not wired into service lifecycle, provider lifecycle, or messaging. Container rejects a value bound under a class token that declares @OnProvision, @OnDeprovision, or a messaging handler, because it owns no instance to run them on.

The type field is optional for value bindings. Value-shaped descriptors do not support transient scope.

Type Parameters ​

Type ParameterDefault typeDescription
TunknownValue type resolved for the token.

Properties ​

token ​

ts
readonly token: ServiceToken<T>;

Defined in: src/wirestate-core/binding/binding.ts:87

Token used to resolve the stored value.


type? ​

ts
readonly optional type?: "Value";

Defined in: src/wirestate-core/binding/binding.ts:82

Binding strategy. Optional for ordinary value descriptors.


value ​

ts
readonly value: T;

Defined in: src/wirestate-core/binding/binding.ts:92

Value returned when the token is resolved.