lit.SignalsController
Lit ReactiveController that connects a reactive object or domain store to a Lit element.
Remarks
When the element connects to the DOM, SignalsController establishes a reactive effect
that listens to mutations on the target object and triggers host.requestUpdate().
When the element disconnects, the effect is automatically disposed.
Example
| Name | Type | Description |
|---|---|---|
T |
extends object |
The type of reactive target object or store. |
new SignalsController<T>(host, target)
Creates a new SignalsController instance and registers it with the host element.
| Name | Type |
|---|---|
T |
extends object |
| Name | Type | Description |
|---|---|---|
host |
ReactiveControllerHost |
The Lit component host. |
target |
T |
The reactive object or domain store to observe. |
Private Optional disposeEffect: () => void
(): void
void
Private host: ReactiveControllerHost
Private target: T
hostConnected(): void
Subscribes to the reactive target when the host connects to the DOM.
void
ReactiveController.hostConnected
hostDisconnected(): void
Disposes the reactive subscription when the host disconnects from the DOM.
void