0
Fork 0
mirror of https://github.com/TanStack/table.git synced 2026-11-18 18:55:54 +00:00
table/docs/framework/lit/reference/classes/SubscribeDirective.md
Kevin Van Cott 87c6bcc52a
feat(table-core): Further improve tree-shaking across features (#6626)
* feat(table-core): Further improve tree-shaking across features

Keep column ordering, column pinning, and row expanding code out of the
core bundle, route more cross-feature reads through feature stubs, and
stop allocating unused onAfterUpdate wrappers in production memos.

* refactor(table-core): register internal cross-feature fns as table APIs

Replace init*InstanceData function storage with @internal table APIs
registered via assignTableAPIs, route faceting through the
getCanGlobalFilter stub, and enforce feature boundaries with
import/no-restricted-paths. Regenerate reference docs and fix stale
docs config links.

---------
2026-10-12 09:51:47 -05:00

5.1 KiB

id title
SubscribeDirective 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" ReactiveControllerHost to bridge the gap between TanStack's standard controller requirements and the AsyncDirective lifecycle.

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