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

table-state

하는 일

이 스킬은 Ember 앱에서 현재 페이지 같은 표 설정을 추적 속성에 보관하는 방법을 설명합니다. 그 설정이 템플릿과 계속 맞춰지기를 원하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓템플릿이 현재 페이지나 다른 표 설정을 보여 줘야 할 때.
  • ✓버튼이 페이지 같은 표 설정을 바꿔야 할 때.
  • ✓설정을 바꾼 뒤 표의 값이 화면에서 업데이트되지 않는 경우.

스킬 링크

https://github.com/TanStack/table/blob/main/packages/ember-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/ember-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에게 요청하는 예시

“Ember 표의 다음 페이지 버튼을 누르면 화면의 페이지 번호도 바뀌게 하려면 어떻게 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

페이지네이션 설정을 추적 속성에 보관하고, 표에 넘긴 뒤 콜백에서 업데이트하는 방법을 보여 줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Load intent load @tanstack/table-core#table-state first for shared ownership, initialization, updater, and reset rules.

Glimmer tracks Table APIs, atom reads, and store-property reads inside template-consumed getters. A value cached outside tracked consumption is only a snapshot. There is no table.Subscribe or selector argument to useTable; table.store.subscribe is intentionally a no-op and cannot drive rendering.

Controlled tracked setup

import Component from '@glimmer/component'
import { tracked } from '@glimmer/tracking'
import { on } from '@ember/modifier'
import {
  rowPaginationFeature,
  tableFeatures,
  useTable,
  type PaginationState,
} from '@tanstack/ember-table'

const features = tableFeatures({ rowPaginationFeature })
const columns = [{ accessorKey: 'name' }]
const data = [{ name: 'Ada' }]

export default class PageStatus extends Component {
  @tracked pagination: PaginationState = { pageIndex: 0, pageSize: 10 }
  table = useTable(this, () => ({
    features,
    columns,
    data,
    state: { pagination: this.pagination },
    onPaginationChange: (next) => {
      this.pagination =
        typeof next === 'function' ? next(this.pagination) : next
    },
  }))

  get pageNumber() {
    return this.table.atoms.pagination.get().pageIndex + 1
  }

  nextPage = () => this.table.nextPage()

  <template>
    <button type='button' {{on 'click' this.nextPage}}>Page
      {{this.pageNumber}}</button>
  </template>
}

Reactive boundaries

  • Read tracked values inside the options thunk and assign callback results back to their tracked owner. Mutating this.pagination.pageIndex++ does not notify the thunk.
  • features and atoms are construction-time inputs. Updating ordinary live options does not replace the feature set or atom owners; create them once before useTable.
  • Pass the component as the owner for lifecycle cleanup when external atoms are used. The standalone one-argument thunk form remains supported.
  • Use the adapter's createAtom for external Glimmer-reactive ownership. Read it in a tracked getter and use feature APIs or the external atom to write.
  • Keep features, columns, and data stable. Call receiver-dependent methods through getters or helpers rather than passing extracted methods to templates.

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/ember-table/declarations/index.d.ts, use-table.d.ts, signal.d.ts, and FlexRender.d.ts. Core feature APIs are in node_modules/@tanstack/table-core/dist/features/.

자주 묻는 질문

템플릿 밖에서 읽은 값은 왜 업데이트되지 않나요?

추적 소비 밖에서 캐시된 값은 스냅샷이라 스스로 새로 고쳐지지 않습니다.

Ember에 Subscribe 컴포넌트가 있나요?

아니요, 없습니다. 이 스킬은 스토어 구독이 렌더링을 일으키지 않는다고 설명합니다.

코드에서 현재 페이지를 여전히 읽을 수 있나요?

네, 템플릿이 사용하는 getter에서 읽을 수 있습니다.

상세 정보

작성자의 원본 설명

Read and control Table v9 state in ember. Use for tracked reads, subscriptions, controlled slices, and framework-specific reactive boundaries.

repo: TanStack/table

인기도

GitHub 스타
29k
순위
#9812
라이선스
MIT
업데이트
2026. 10. 21.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬