table-state
できること
このスキルは、シグナルで作られたAngularアプリで、現在のページなどの表の状態がどう働くかを説明します。表と自分のコンポーネントが、同じ値に反応する必要がある開発者向けです。
使う場面
- ✓テンプレートに、表の現在のページ番号や他の設定を表示する必要があるとき。
- ✓表のページの設定をAngularのシグナルにつなぐ必要があるとき。
- ✓表が変わった後に、計算された値やエフェクトが更新されないとき。
スキルのリンク
https://github.com/TanStack/table/blob/main/packages/angular-table/skills/table-state/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Angularの表の現在のページ番号を、ボタンのラベルに表示するにはどうすればよいですか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
表の状態をシグナルに保持し、表に渡し、コールバックを通じて更新する方法を示します。そうすることで、両方が同じ状態を保ちます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Load intent load @tanstack/table-core#table-state first for shared ownership, initialization, updater, and reset rules.
Angular-backed atom reads participate in tracking inside templates, computed, and effect. A value captured outside those contexts is only a snapshot. Use computed for derivation or equality control; wrapping an atom is not required to make it reactive.
Controlled signal setup
<!-- skill-snippet:check tsconfig=scripts/skill-snippets-angular.tsconfig.json -->import { Component, signal } from '@angular/core'
import {
injectTable,
rowPaginationFeature,
tableFeatures,
} from '@tanstack/angular-table'
const features = tableFeatures({ rowPaginationFeature })
const columns = [{ accessorKey: 'name' }]
const data = [{ name: 'Ada' }]
@Component({
selector: 'page-status',
template: `<button (click)="table.nextPage()">
Page {{ table.atoms.pagination.get().pageIndex + 1 }}
</button>`,
})
export class PageStatus {
readonly pagination = signal({ pageIndex: 0, pageSize: 20 })
readonly table = injectTable(() => ({
features,
columns,
data,
state: { pagination: this.pagination() },
onPaginationChange: (next) =>
typeof next === 'function'
? this.pagination.update(next)
: this.pagination.set(next),
}))
}
Reactive boundaries
- Construct in Angular injection context. Signal writes used by the initializer rerun it and call
setOptions; hoist features and columns and keep data references stable. - Supply both
state.paginationandonPaginationChangewhen a signal owns the slice. Resolve updater functions with.update(next)instead of storing the function with.set(next). - For shared state, create a stable atom with
@tanstack/angular-storeand pass it throughatoms. Its writes do not need to flow through a controlled signal in the initializer. - Use
table.store.get()for the flat state. Prefertable.atoms.<slice>.get()for narrow tracked reads.
Read for the task
For advanced reactive boundaries, shared atoms, or detailed subscription examples, read reactivity. For construction or rendering setup, read getting-started.
API discovery
Inspect node_modules/@tanstack/angular-table/dist/types/ for the bundled public declarations. Inspect feature APIs under node_modules/@tanstack/table-core/dist/features/.
よくある質問
表の値をリアクティブにするのに、特別なヘルパーが常に必要ですか?
いいえ、値をヘルパーで包む必要は、リアクティブにするためには必要ないとスキルは述べています。
コピーした値が更新されないのはなぜですか?
テンプレート、計算された値、エフェクトの外で読まれた値は単なるスナップショットなので、自動では更新されません。
表はどこで作るべきですか?
表はinjectTableで作られ、Angularのインジェクションのコンテキストで実行される必要があります。
詳細
作者による元の説明
Read and control Table v9 state in angular. Use for tracked reads, subscriptions, controlled slices, and framework-specific reactive boundaries.
repo: TanStack/table
人気
- GitHubのスター
- 29k
- ランキング
- #9810
- ライセンス
- MIT
- 更新日
- 2026/10/21
コメント
- …
このリポジトリの他のスキル
getting-started
29kエージェントが、Alpine.jsでTanStack Tableを使ってデータテーブルを作り、表示する方法を教えます。セットアップ、リアクティブなデータ、行の描画を扱います。
table-state
29kエージェントが、Alpine.jsで表の状態(現在のページなど)を読み取り、制御する方法を教えます。その状態が変わると、画面が更新されます。
devtools
29kエージェントが、Angularの表をTanStack Devtoolsのパネルに登録する方法を教えます。開発者はアプリを作りながら、各表を調べられます。
getting-started
29kエージェントが、AngularでTanStack Tableの表を作り、表示する方法を教えます。injectTableの設定、テンプレートの描画、行データの更新を扱います。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。