본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)29k · #9810

table-state

하는 일

이 스킬은 시그널 기반 Angular 앱에서 현재 페이지 같은 표 상태가 어떻게 작동하는지 설명합니다. 표와 자신의 컴포넌트가 같은 값에 반응해야 하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓템플릿이 현재 페이지 번호나 다른 표 설정을 보여 줘야 할 때.
  • ✓표의 페이지 설정을 Angular 시그널과 연결해야 할 때.
  • ✓표가 바뀌었는데 계산된 값이나 effect가 업데이트되지 않는 경우.

스킬 링크

https://github.com/TanStack/table/blob/main/packages/angular-table/skills/table-state/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/TanStack/table/blob/main/packages/angular-table/skills/table-state/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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.pagination and onPaginationChange when 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-store and pass it through atoms. Its writes do not need to flow through a controlled signal in the initializer.
  • Use table.store.get() for the flat state. Prefer table.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/.

자주 묻는 질문

값을 반응형으로 만들려면 항상 특별한 도우미가 필요한가요?

아니요, 이 스킬은 값을 반응형으로 만들기 위해 도우미로 감쌀 필요가 없다고 설명합니다.

복사한 값이 왜 업데이트되지 않나요?

템플릿, computed, effect 밖에서 읽은 값은 순간의 스냅샷일 뿐이라 스스로 새로 고쳐지지 않습니다.

표는 어디서 만들어야 하나요?

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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬