(options: TableOptions<TData>)
| 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 | } |
nothing calls this directly
no test coverage detected