Skip to content

wirestate-lit

Lit integration APIs for container providers, injection decorators, and element-scoped message handlers.

Commands

NameDescription
OnCommandControllerReactive controller that registers a command handler.
OnCommandDecoratorDescribes type returned by onCommand.
UseOnCommandOptionsDescribes options for useOnCommand.
onCommandDecorator for Lit element methods that handle a specific command.
useOnCommandRegisters a command handler for the host element's lifetime.

Container

NameDescription
ContainerProviderReactive controller that provides a root container through Lit context.
ContainerProviderOptionsDescribes options for ContainerProvider.
ProvideContainerDecoratorDescribes the type returned by provideContainer.
UseContainerProviderOptionsDescribes options for useContainerProvider.
ContainerContextLit context object for providing and consuming the container.
provideContainerDecorator that provides an IoC container to child components.
useContainerProviderHook that provides a container to the host element and its children.

Events

NameDescription
OnEventControllerReactive controller that subscribes to container events.
OnEventDecoratorDescribes type returned by onEvent.
UseOnEventsOptionsDescribes options for useOnEvents.
onEventDecorator for Lit element methods that handle events from the event bus.
useOnEventsSubscribes to events for the host element's lifetime.

Injection

NameDescription
InjectionDecoratorDescribes type returned by injection.
InjectionOptionsDescribes options for injection.
UseContainerValueDescribes value returned by useContainer.
UseInjectionOptionsDescribes options for useInjection.
UseInjectionValueDescribes value returned by useInjection.
InjectionFallbackA fallback for an optional injection: a raw value or a (container) => value factory, used only when the token is not bound.
injectionInjects a container value into a Lit element property.
useContainerConsumes the active container from the nearest Lit context.
useInjectionConsumes a value from the nearest Lit container context.

Queries

NameDescription
OnQueryControllerReactive controller that registers a query handler.
OnQueryDecoratorDescribes type returned by onQuery.
UseOnQueryOptionsDescribes options for useOnQuery.
onQueryDecorator for Lit element methods that handle a specific query.
useOnQueryRegisters a query handler for the host element's lifetime.