Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@
{ "to": "framework/react/examples/basic-use-legacy-table", "label": "Basic (useLegacyTable)" },
{ "to": "framework/react/examples/basic-external-state", "label": "Basic (External State)" },
{ "to": "framework/react/examples/basic-external-atoms", "label": "Basic (External Atoms)" },
{ "to": "framework/react/examples/basic-subscribe", "label": "Basic (Subscribe)" },
{ "to": "framework/react/examples/column-groups", "label": "Header Groups" }
]
},
Expand Down Expand Up @@ -864,6 +865,7 @@
{ "to": "framework/preact/examples/basic-use-app-table", "label": "Basic (useAppTable)" },
{ "to": "framework/preact/examples/basic-external-state", "label": "Basic (External State)" },
{ "to": "framework/preact/examples/basic-external-atoms", "label": "Basic (External Atoms)" },
{ "to": "framework/preact/examples/basic-subscribe", "label": "Basic (Subscribe)" },
{ "to": "framework/preact/examples/column-groups", "label": "Header Groups" }
]
},
Expand Down
6 changes: 3 additions & 3 deletions docs/framework/angular/reference/functions/injectTable.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: injectTable
# Function: injectTable()

```ts
function injectTable<TFeatures, TData, TSelected>(options, selector): AngularTable<TFeatures, TData, TSelected>;
function injectTable<TFeatures, TData, TSelected>(options, selector?): AngularTable<TFeatures, TData, TSelected>;
```

Defined in: [injectTable.ts:124](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L124)
Defined in: [injectTable.ts:133](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L133)

Creates and returns an Angular-reactive table instance.

Expand Down Expand Up @@ -42,7 +42,7 @@ The returned table is also signal-reactive: table state and table APIs are wired

() => `TableOptions`\<`TFeatures`, `TData`\>

### selector
### selector?

(`state`) => `TSelected`

Expand Down
1 change: 1 addition & 0 deletions docs/framework/angular/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ title: "@tanstack/angular-table"
- [FlexRenderContent](type-aliases/FlexRenderContent.md)
- [FlexRenderInputContent](type-aliases/FlexRenderInputContent.md)
- [RenderableComponent](type-aliases/RenderableComponent.md)
- [SubscribeSource](type-aliases/SubscribeSource.md)

## Variables

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: AngularTableComputed

# Interface: AngularTableComputed()\<TFeatures\>

Defined in: [injectTable.ts:28](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L28)
Defined in: [injectTable.ts:40](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L40)

Store mode: pass `selector` (required) to project from full table state.
Source mode: pass `source` (atom or store); omit `selector` for the whole value
Expand All @@ -24,7 +24,7 @@ inference.
AngularTableComputed<TSourceValue>(props): Signal<Readonly<TSourceValue>>;
```

Defined in: [injectTable.ts:29](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L29)
Defined in: [injectTable.ts:41](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L41)

Store mode: pass `selector` (required) to project from full table state.
Source mode: pass `source` (atom or store); omit `selector` for the whole value
Expand All @@ -51,7 +51,7 @@ inference.

##### source

`Atom`\<`TSourceValue`\> \| `ReadonlyAtom`\<`TSourceValue`\>
[`SubscribeSource`](../type-aliases/SubscribeSource.md)\<`TSourceValue`\>

### Returns

Expand All @@ -63,7 +63,7 @@ inference.
AngularTableComputed<TSourceValue, TSubSelected>(props): Signal<Readonly<TSubSelected>>;
```

Defined in: [injectTable.ts:34](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L34)
Defined in: [injectTable.ts:46](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L46)

Store mode: pass `selector` (required) to project from full table state.
Source mode: pass `source` (atom or store); omit `selector` for the whole value
Expand Down Expand Up @@ -94,7 +94,7 @@ inference.

##### source

`Atom`\<`TSourceValue`\> \| `ReadonlyAtom`\<`TSourceValue`\>
[`SubscribeSource`](../type-aliases/SubscribeSource.md)\<`TSourceValue`\>

### Returns

Expand All @@ -106,7 +106,7 @@ inference.
AngularTableComputed<TSubSelected>(props): Signal<Readonly<TSubSelected>>;
```

Defined in: [injectTable.ts:39](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L39)
Defined in: [injectTable.ts:51](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L51)

Store mode: pass `selector` (required) to project from full table state.
Source mode: pass `source` (atom or store); omit `selector` for the whole value
Expand Down
29 changes: 3 additions & 26 deletions docs/framework/angular/reference/type-aliases/AngularTable.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,19 @@ title: AngularTable
type AngularTable<TFeatures, TData, TSelected> = Table<TFeatures, TData> & object;
```

Defined in: [injectTable.ts:45](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L45)
Defined in: [injectTable.ts:57](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L57)

## Type Declaration

### computed()
### computed

```ts
computed: <TSubSelected>(props) => Signal<Readonly<TSubSelected>>;
computed: AngularTableComputed<TFeatures>;
```

Creates a computed that subscribe to changes in the table store with a custom selector.
Default equality function is "shallow".

#### Type Parameters

##### TSubSelected

`TSubSelected` = \{
\}

#### Parameters

##### props

###### equal?

`ValueEqualityFn`\<`TSubSelected`\>

###### selector

(`state`) => `TSubSelected`

#### Returns

`Signal`\<`Readonly`\<`TSubSelected`\>\>

### state

```ts
Expand Down
22 changes: 22 additions & 0 deletions docs/framework/angular/reference/type-aliases/SubscribeSource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
id: SubscribeSource
title: SubscribeSource
---

# Type Alias: SubscribeSource\<TValue\>

```ts
type SubscribeSource<TValue> =
| Atom<TValue>
| ReadonlyAtom<TValue>
| Store<TValue>
| ReadonlyStore<TValue>;
```

Defined in: [injectTable.ts:28](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L28)

## Type Parameters

### TValue

`TValue`
53 changes: 15 additions & 38 deletions docs/framework/react/reference/index/functions/Subscribe.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ title: Subscribe
## Call Signature

```ts
function Subscribe<TFeatures, TData, TSourceValue>(props): ReactNode | Promise<ReactNode>;
function Subscribe<TSourceValue>(props): ReactNode | Promise<ReactNode>;
```

Defined in: [Subscribe.ts:148](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L148)
Defined in: [Subscribe.ts:125](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L125)

A React component that allows you to subscribe to the table state.

Expand All @@ -22,14 +22,6 @@ contextual typing works. This standalone component uses a union `props` type.

### Type Parameters

#### TFeatures

`TFeatures` *extends* `TableFeatures`

#### TData

`TData` *extends* `RowData`

#### TSourceValue

`TSourceValue`
Expand All @@ -38,7 +30,7 @@ contextual typing works. This standalone component uses a union `props` type.

#### props

[`SubscribePropsWithSourceIdentity`](../type-aliases/SubscribePropsWithSourceIdentity.md)\<`TFeatures`, `TData`, `TSourceValue`\>
[`SubscribePropsWithSourceIdentity`](../type-aliases/SubscribePropsWithSourceIdentity.md)\<`TSourceValue`\>

### Returns

Expand All @@ -48,7 +40,7 @@ contextual typing works. This standalone component uses a union `props` type.

```tsx
// As a standalone component — full store
<Subscribe table={table} selector={(state) => ({ rowSelection: state.rowSelection })}>
<Subscribe source={table.store} selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
Expand All @@ -57,15 +49,14 @@ contextual typing works. This standalone component uses a union `props` type.

```tsx
// Entire source (atom or store) — no selector
<Subscribe table={table} source={table.atoms.rowSelection}>
<Subscribe source={table.atoms.rowSelection}>
{(rowSelection) => <div>...</div>}
</Subscribe>
```

```tsx
// Project source value (e.g. one row’s selection)
<Subscribe
table={table}
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection?.[row.id]}
>
Expand All @@ -85,10 +76,10 @@ contextual typing works. This standalone component uses a union `props` type.
## Call Signature

```ts
function Subscribe<TFeatures, TData, TSourceValue, TSelected>(props): ReactNode | Promise<ReactNode>;
function Subscribe<TSourceValue, TSelected>(props): ReactNode | Promise<ReactNode>;
```

Defined in: [Subscribe.ts:155](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L155)
Defined in: [Subscribe.ts:128](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L128)

A React component that allows you to subscribe to the table state.

Expand All @@ -99,14 +90,6 @@ contextual typing works. This standalone component uses a union `props` type.

### Type Parameters

#### TFeatures

`TFeatures` *extends* `TableFeatures`

#### TData

`TData` *extends* `RowData`

#### TSourceValue

`TSourceValue`
Expand All @@ -119,7 +102,7 @@ contextual typing works. This standalone component uses a union `props` type.

#### props

[`SubscribePropsWithSourceWithSelector`](../type-aliases/SubscribePropsWithSourceWithSelector.md)\<`TFeatures`, `TData`, `TSourceValue`, `TSelected`\>
[`SubscribePropsWithSourceWithSelector`](../type-aliases/SubscribePropsWithSourceWithSelector.md)\<`TSourceValue`, `TSelected`\>

### Returns

Expand All @@ -129,7 +112,7 @@ contextual typing works. This standalone component uses a union `props` type.

```tsx
// As a standalone component — full store
<Subscribe table={table} selector={(state) => ({ rowSelection: state.rowSelection })}>
<Subscribe source={table.store} selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
Expand All @@ -138,15 +121,14 @@ contextual typing works. This standalone component uses a union `props` type.

```tsx
// Entire source (atom or store) — no selector
<Subscribe table={table} source={table.atoms.rowSelection}>
<Subscribe source={table.atoms.rowSelection}>
{(rowSelection) => <div>...</div>}
</Subscribe>
```

```tsx
// Project source value (e.g. one row’s selection)
<Subscribe
table={table}
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection?.[row.id]}
>
Expand All @@ -166,10 +148,10 @@ contextual typing works. This standalone component uses a union `props` type.
## Call Signature

```ts
function Subscribe<TFeatures, TData, TSelected>(props): ReactNode | Promise<ReactNode>;
function Subscribe<TFeatures, TSelected>(props): ReactNode | Promise<ReactNode>;
```

Defined in: [Subscribe.ts:168](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L168)
Defined in: [Subscribe.ts:131](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L131)

A React component that allows you to subscribe to the table state.

Expand All @@ -184,10 +166,6 @@ contextual typing works. This standalone component uses a union `props` type.

`TFeatures` *extends* `TableFeatures`

#### TData

`TData` *extends* `RowData`

#### TSelected

`TSelected`
Expand All @@ -196,7 +174,7 @@ contextual typing works. This standalone component uses a union `props` type.

#### props

[`SubscribePropsWithStore`](../type-aliases/SubscribePropsWithStore.md)\<`TFeatures`, `TData`, `TSelected`\>
[`SubscribePropsWithStore`](../type-aliases/SubscribePropsWithStore.md)\<`TFeatures`, `TSelected`\>

### Returns

Expand All @@ -206,7 +184,7 @@ contextual typing works. This standalone component uses a union `props` type.

```tsx
// As a standalone component — full store
<Subscribe table={table} selector={(state) => ({ rowSelection: state.rowSelection })}>
<Subscribe source={table.store} selector={(state) => ({ rowSelection: state.rowSelection })}>
{({ rowSelection }) => (
<div>Selected rows: {Object.keys(rowSelection).length}</div>
)}
Expand All @@ -215,15 +193,14 @@ contextual typing works. This standalone component uses a union `props` type.

```tsx
// Entire source (atom or store) — no selector
<Subscribe table={table} source={table.atoms.rowSelection}>
<Subscribe source={table.atoms.rowSelection}>
{(rowSelection) => <div>...</div>}
</Subscribe>
```

```tsx
// Project source value (e.g. one row’s selection)
<Subscribe
table={table}
source={table.atoms.rowSelection}
selector={(rowSelection) => rowSelection?.[row.id]}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ TFeatures is already known from the createTableHook call; TData is inferred from

##### TSelected

`TSelected` = \{
\}
`TSelected` = `TableState`\<`TFeatures`\>

#### Parameters

Expand Down
9 changes: 4 additions & 5 deletions docs/framework/react/reference/index/functions/useTable.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: useTable
# Function: useTable()

```ts
function useTable<TFeatures, TData, TSelected>(tableOptions, selector): ReactTable<TFeatures, TData, TSelected>;
function useTable<TFeatures, TData, TSelected>(tableOptions, selector?): ReactTable<TFeatures, TData, TSelected>;
```

Defined in: [useTable.ts:112](https://github.com/TanStack/table/blob/main/packages/react-table/src/useTable.ts#L112)
Defined in: [useTable.ts:108](https://github.com/TanStack/table/blob/main/packages/react-table/src/useTable.ts#L108)

## Type Parameters

Expand All @@ -23,16 +23,15 @@ Defined in: [useTable.ts:112](https://github.com/TanStack/table/blob/main/packag

### TSelected

`TSelected` = \{
\}
`TSelected` = `TableState`\<`TFeatures`\>

## Parameters

### tableOptions

`TableOptions`\<`TFeatures`, `TData`\>

### selector
### selector?

(`state`) => `TSelected`

Expand Down
Loading
Loading