Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
Table API Reference
Column API Reference
Row API Reference
Cell API Reference
Header API Reference
Features API Reference
Static Functions API Reference
Table API Reference

subscribeTable

Function: subscribeTable()

Call Signature

ts
function subscribeTable<TSourceValue>(source): object;
function subscribeTable<TSourceValue>(source): object;

Defined in: packages/svelte-table/src/subscribe.ts:34

Creates a fine-grained Svelte subscription to a TanStack Store source.

Pass a table atom or store and optionally project it with a selector. The returned selector store exposes .current, making it useful for reading focused table state outside the broad createTable selector.

Type Parameters

TSourceValue

TSourceValue

Parameters

source

SubscribeSource<TSourceValue>

Returns

object

current

ts
readonly current: NoInfer<TSourceValue>;
readonly current: NoInfer<TSourceValue>;

Example

svelte
<script lang="ts">
  const selected = subscribeTable(
    table.atoms.rowSelection,
    (rowSelection) => rowSelection[row.id],
  )
</script>

<input type="checkbox" checked={!!selected.current} />
<script lang="ts">
  const selected = subscribeTable(
    table.atoms.rowSelection,
    (rowSelection) => rowSelection[row.id],
  )
</script>

<input type="checkbox" checked={!!selected.current} />

Call Signature

ts
function subscribeTable<TSourceValue, TSelected>(source, selector): object;
function subscribeTable<TSourceValue, TSelected>(source, selector): object;

Defined in: packages/svelte-table/src/subscribe.ts:37

Creates a fine-grained Svelte subscription to a TanStack Store source.

Pass a table atom or store and optionally project it with a selector. The returned selector store exposes .current, making it useful for reading focused table state outside the broad createTable selector.

Type Parameters

TSourceValue

TSourceValue

TSelected

TSelected

Parameters

source

SubscribeSource<TSourceValue>

selector

(state) => TSelected

Returns

object

current

ts
readonly current: TSelected;
readonly current: TSelected;

Example

svelte
<script lang="ts">
  const selected = subscribeTable(
    table.atoms.rowSelection,
    (rowSelection) => rowSelection[row.id],
  )
</script>

<input type="checkbox" checked={!!selected.current} />
<script lang="ts">
  const selected = subscribeTable(
    table.atoms.rowSelection,
    (rowSelection) => rowSelection[row.id],
  )
</script>

<input type="checkbox" checked={!!selected.current} />