MCPcopy Index your code
hub / github.com/TanStack/table / table

Method table

packages/lit-table/src/index.ts:39–67  ·  view source on GitHub ↗
(options: TableOptions<TData>)

Source from the content-addressed store, hash-verified

37 }
38
39 public table(options: TableOptions<TData>) {
40 if (!this.tableInstance) {
41 const resolvedOptions: TableOptionsResolved<TData> = {
42 state: {},
43 onStateChange: () => {}, // noop
44 renderFallbackValue: null,
45 ...options,
46 }
47
48 this.tableInstance = createTable(resolvedOptions)
49 this._tableState = {
50 ...this.tableInstance.initialState,
51 ...options.state,
52 }
53 }
54
55 this.tableInstance.setOptions((prev) => ({
56 ...prev,
57 ...options,
58 state: { ...this._tableState, ...options.state },
59 onStateChange: (updater: any) => {
60 this._tableState = updater(this._tableState)
61 this.host.requestUpdate()
62 options.onStateChange?.(updater)
63 },
64 }))
65
66 return this.tableInstance
67 }
68
69 hostDisconnected() {}
70}

Callers

nothing calls this directly

Calls 1

createTableFunction · 0.90

Tested by

no test coverage detected