Skip to content

wirestate-core

Framework-agnostic Wirestate APIs for containers, services, lifecycle, messaging, and dependency injection.

Bind

NameDescription
InjectionTokenTyped reference token for dependencies stored in a container.
FactoryBindingDescriptorDescribes a token-bound value produced by a factory function.
InstanceBindingDescriptorDescribes a token-bound service instance constructed from an injectable class.
ValueBindingDescriptorDescribes a token-bound value stored directly in the container.
BindingBinding entry accepted by container registration APIs.
BindingDescriptorDescriptor object that binds a token to a value, class, or factory strategy.
BindingScopeValueBinding lifetime scope name.
BindingTypeValueBinding strategy name.
BindingScopeLifetime scope names accepted by binding descriptors:
BindingTypeBinding strategy names accepted by binding descriptors.

Commands

NameDescription
CommandBusDispatches commands to the active handler for each command type.
CommandDispatchOptionsPer-dispatch options for CommandBus.execute and CommandBus.executeAsync.
OnCommandDecoratorDescribes the decorator returned by OnCommand.
CommandHandlerHandles a dispatched command payload and returns the command result.
CommandTypeIdentifies one imperative message handled by a command handler.
CommandUnregisterRemoves one command handler registration.
OnCommandMarks an injectable service method as a provision-scoped command handler.

Container

NameDescription
ContainerDependency injection container for one Wirestate scope.
ContainerConfigDefines one Container scope at construction time.
InjectableDecoratorDescribes the decorator returned by Injectable.
ServiceTokenToken accepted by container lookup and injection APIs.
injectResolves a dependency from the container currently constructing a service.
InjectableMarks a class as eligible for Wirestate instance bindings.
isInjectableChecks whether a class was directly marked with Injectable.
validateContainerConfigValidates container construction config without creating a container.

Error

NameDescription
WirestateErrorError type thrown for expected Wirestate API failures.
InternalErrorDescriptorDescribes an isolated failure reported through a container error handler.
InternalErrorHandlerHandles isolated Wirestate errors for a container.
InternalErrorSource-
defaultInternalErrorHandlerReports isolated Wirestate errors to console.error.

Events

NameDescription
EventBusBroadcasts events to every subscriber registered on one container bus.
EventEmitOptionsOptions for emitting an event.
OnEventDecoratorDescribes the decorator returned by OnEvent.
WireEventEvent delivered to handlers: its type, optional payload, and optional source.
EventHandlerReceives an emitted event from the bus.
EventTypeIdentifies an event for emitting and subscribing.
EventUnsubscribeRemoves the event subscription it was returned for.
OnEventMarks an injectable service method as a provision-scoped event handler.

General Types

NameDescription
AbstractClassAbstract class reference that cannot be constructed directly, but can serve as a binding token.
NewableConstructor type for a concrete class Wirestate can instantiate.

Lifecycle

NameDescription
WireStatusLifecycle status for one resolved service instance.
LifecycleDecoratorMethod decorator returned by the single-method lifecycle hooks: @OnActivation, @OnDeactivation, @OnProvision, and @OnDeprovision.
ProvisionIdNumeric ID for one provider provision cycle of a service instance.
OnActivationRuns an instance method after container activation completes.
OnDeactivationRuns an instance method during container deactivation.
OnDeprovisionRuns before a framework provider stops exposing the container.
OnProvisionRuns when a framework provider exposes the container.

Plugins

NameDescription
CommandsPluginEnables command messaging on a container.
EventsPluginEnables event messaging on a container.
QueriesPluginEnables query messaging on a container.
WirestatePluginA container lifecycle plugin.

Queries

NameDescription
QueryBusDispatches queries to the active handler for each query type.
OnQueryDecoratorDescribes the decorator returned by OnQuery.
QueryDispatchOptionsPer-dispatch options for QueryBus.query and QueryBus.queryAsync.
QueryHandlerAnswers a dispatched query payload and returns the query result.
QueryTypeIdentifies one read-oriented message handled by a query handler.
QueryUnregisterRemoves one query handler registration.
OnQueryMarks an injectable service method as a provision-scoped query handler.