मुख्य सामग्री पर जाएँ
Skillpedia
वेबसाइट और UI (frontend)29k · #9815

table-state

यह क्या करती है

यह स्किल समझाती है कि Lit component में टेबल की सेटिंग, जैसे मौजूदा पेज, कैसे रखें और टेबल उन पर कैसे प्रतिक्रिया देती है। यह उन Lit डेवलपरों के लिए है जिन्हें व्यू और सेटिंग एक जैसी रखनी हैं।

कब इस्तेमाल करें

  • ✓जब Lit टेम्प्लेट में मौजूदा पेज या टेबल की कोई और सेटिंग दिखानी हो।
  • ✓जब आपको component से टेबल को कोई सेटिंग देनी हो।
  • ✓जब टेबल की सेटिंग बदलने के बाद Lit व्यू अपडेट न हो।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/TanStack/table/blob/main/packages/lit-table/skills/table-state/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“अगला पेज बटन क्लिक होने के बाद मेरी Lit टेबल व्यू में पेज नंबर कैसे अपडेट करूँ?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह दिखाती है कि सेटिंग को Lit reactive property में कैसे रखें, उसे टेबल को दें और अपडेट वापस भेजें, ताकि component फिर से रेंडर हो।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

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

TableController selects all registered state by default and requests host updates when selected state changes. table.state is the selected render value. table.atoms.<slice>.get() and table.store.state are snapshots; those reads do not create a template subscription.

Controlled property setup

<!-- skill-snippet:check tsconfig=examples/lit/basic-table-controller/tsconfig.json -->
import { LitElement, html } from 'lit'
import { customElement, state } from 'lit/decorators.js'
import {
  TableController,
  rowPaginationFeature,
  tableFeatures,
  type PaginationState,
} from '@tanstack/lit-table'

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

@customElement('page-status')
export class PageStatus extends LitElement {
  @state() private pagination: PaginationState = { pageIndex: 0, pageSize: 10 }
  private controller = new TableController<typeof features, { id: string }>(
    this,
  )

  protected render() {
    const table = this.controller.table({
      features,
      columns,
      data,
      state: { pagination: this.pagination },
      onPaginationChange: (next) => {
        this.pagination =
          typeof next === 'function' ? next(this.pagination) : next
      },
    })
    return html`<button @click=${() => table.nextPage()}>
      Page ${table.state.pagination.pageIndex + 1}
    </button>`
  }
}

Reactive boundaries

  • Keep one controller on the host and pass current options during render. Keep features, columns, and data references stable across host updates.
  • A second controller.table(options, selector) argument changes the shape of table.state and gates host updates. Keep reused selectors stable.
  • Use table.subscribe(source, selector, renderCallback) for a template region that should update independently. Cache selector functions as host fields or module functions.
  • Feed every controlled callback result into the corresponding reactive property and pass it back through state. Use stable external atoms through atoms when sharing state outside the host.

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/lit-table/dist/index.d.ts, then TableController.d.ts, flexRender.d.ts, or the relevant exported declaration. Core feature APIs are in node_modules/@tanstack/table-core/dist/features/.

अक्सर पूछे जाने वाले सवाल

handler में मान पढ़ना टेम्प्लेट में पढ़ने से अलग क्यों है?

टेम्प्लेट में पढ़ना व्यू को बदलावों से जोड़े रखता है, जबकि handlers में पढ़े मान उसी क्षण के स्नैपशॉट होते हैं।

controller डिफ़ॉल्ट रूप से क्या चुनता है?

यह डिफ़ॉल्ट रूप से पंजीकृत सारी टेबल स्थिति चुनता है और उसके बदलने पर host अपडेट मांगता है।

क्या मैं टेम्प्लेट किन बदलावों को सुने यह सीमित कर सकता हूँ?

हाँ। गाइड के अनुसार टेम्प्लेट के एक हिस्से के लिए स्थिर selector इस्तेमाल किया जा सकता है।

जानकारी

लेखक का मूल विवरण

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

repo: TanStack/table

लोकप्रियता

GitHub स्टार
29k
रैंकिंग में स्थान
#9815
लाइसेंस
MIT
अपडेट की गई
21/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

getting-started

29k

यह आपके एजेंट को Alpine.js में TanStack Table से डेटा टेबल बनाना और दिखाना सिखाती है, जिसमें सेटअप, रिएक्टिव डेटा और पंक्तियाँ दिखाना शामिल है।

कोडिंगवेबसाइट और UI (frontend)

table-state

29k

यह आपके एजेंट को Alpine.js में टेबल की स्थिति, जैसे मौजूदा पेज, पढ़ना और नियंत्रित करना सिखाती है, ताकि वह स्थिति बदलने पर स्क्रीन अपडेट हो।

कोडिंगवेबसाइट और UI (frontend)

devtools

29k

यह आपके एजेंट को Angular टेबल को TanStack Devtools पैनल में रजिस्टर करना सिखाती है, ताकि डेवलपर ऐप बनाते समय हर टेबल की जांच कर सकें।

कोडिंगवेबसाइट और UI (frontend)

getting-started

29k

यह आपके एजेंट को Angular में TanStack टेबल बनाना और दिखाना सिखाती है, जिसमें injectTable सेटअप, टेम्प्लेट रेंडरिंग और पंक्ति डेटा के अपडेट शामिल हैं।

कोडिंगवेबसाइट और UI (frontend)

मिलती-जुलती skills