(target, property: keyof Table<T>)
| 13 | return tableSignal() |
| 14 | }, |
| 15 | get(target, property: keyof Table<T>): any { |
| 16 | if (target[property]) { |
| 17 | return target[property] |
| 18 | } |
| 19 | const table = untracked(tableSignal) |
| 20 | /** |
| 21 | * Attempt to convert all accessors into computed ones, |
| 22 | * excluding handlers as they do not retain any reactive value |
| 23 | */ |
| 24 | if ( |
| 25 | property.startsWith('get') && |
| 26 | !property.endsWith('Handler') |
| 27 | // e.g. getCoreRowModel, getSelectedRowModel etc. |
| 28 | // We need that after a signal change even `rowModel` may mark the view as dirty. |
| 29 | // This allows to always get the latest `getContext` value while using flexRender |
| 30 | // && !property.endsWith('Model') |
| 31 | ) { |
| 32 | const maybeFn = table[property] as Function | never |
| 33 | if (typeof maybeFn === 'function') { |
| 34 | Object.defineProperty(target, property, { |
| 35 | value: toComputed(tableSignal, maybeFn), |
| 36 | configurable: true, |
| 37 | enumerable: true, |
| 38 | }) |
| 39 | return target[property] |
| 40 | } |
| 41 | } |
| 42 | // @ts-expect-error |
| 43 | return (target[property] = table[property]) |
| 44 | }, |
| 45 | has(_, prop: keyof Table<T>) { |
| 46 | return !!untracked(tableSignal)[prop] |
| 47 | }, |
no test coverage detected