5.1 KiB
| id | title |
|---|---|
| SubscribeDirective | SubscribeDirective |
Class: SubscribeDirective
Defined in: packages/lit-table/src/subscribe-directive.ts:43
An asynchronous Lit directive that subscribes to a @tanstack/lit-store
source and triggers re-renders specifically for the template portion it wraps.
- It uses a "fake"
ReactiveControllerHostto bridge the gap between TanStack's standard controller requirements and theAsyncDirectivelifecycle.
Extends
AsyncDirective
Constructors
Constructor
new SubscribeDirective(_partInfo): SubscribeDirective;
Defined in: node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/development/directive.d.ts:61
Parameters
_partInfo
PartInfo
Returns
SubscribeDirective
Inherited from
AsyncDirective.constructor
Properties
isConnected
isConnected: boolean;
Defined in: node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/development/async-directive.d.ts:143
The connection state for this Directive.
Inherited from
AsyncDirective.isConnected
Accessors
_$isConnected
Get Signature
get _$isConnected(): boolean;
Defined in: node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/development/directive.d.ts:62
Returns
boolean
Inherited from
AsyncDirective._$isConnected
Methods
_$initialize()
_$initialize(
part,
parent,
attributeIndex): void;
Defined in: node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/development/async-directive.d.ts:150
Initialize the part with internal fields
Parameters
part
Part
parent
Disconnectable
attributeIndex
number | undefined
Returns
void
Inherited from
AsyncDirective._$initialize
disconnected()
disconnected(): void;
Defined in: packages/lit-table/src/subscribe-directive.ts:147
Cleans up the controller subscription when the directive is removed from the DOM.
Returns
void
Overrides
AsyncDirective.disconnected
reconnected()
reconnected(): void;
Defined in: packages/lit-table/src/subscribe-directive.ts:152
Restores the controller subscription when the directive is re-attached to the DOM.
Returns
void
Overrides
AsyncDirective.reconnected
render()
Call Signature
render<TSource>(source, template): unknown;
Defined in: packages/lit-table/src/subscribe-directive.ts:61
Renders the entire state of the source without a selector.
Type Parameters
TSource
TSource
Parameters
source
SelectionSource<TSource>
The store or atom to subscribe to.
template
TemplateFunction<TSource>
The render function receiving the full state.
Returns
unknown
Overrides
AsyncDirective.render
Call Signature
render<TSource, TSelected>(
source,
selector,
template): unknown;
Defined in: packages/lit-table/src/subscribe-directive.ts:72
Renders a specific slice of state derived via a selector function.
Type Parameters
TSource
TSource
TSelected
TSelected
Parameters
source
SelectionSource<TSource>
The store or atom to subscribe to.
selector
Selector<TSource, TSelected>
A function to extract the relevant slice of state.
template
TemplateFunction<TSelected>
The render function receiving the selected state slice.
Returns
unknown
Overrides
AsyncDirective.render
setValue()
setValue(value): void;
Defined in: node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/development/async-directive.d.ts:161
Sets the value of the directive's Part outside the normal update/render
lifecycle of a directive.
This method should not be called synchronously from a directive's update
or render.
Parameters
value
unknown
The value to set
Returns
void
Inherited from
AsyncDirective.setValue
update()
update(_part, args): unknown;
Defined in: packages/lit-table/src/subscribe-directive.ts:87
Parameters
_part
Part
args
[SelectionSource<any>, TemplateFunction<any>] | [SelectionSource<any>, Selector<any, any>, TemplateFunction<any>]
Returns
unknown
Overrides
AsyncDirective.update