@@ -7,7 +7,6 @@ import type {
77 Table ,
88 TableFeatures ,
99 TableOptions ,
10- TableOptionsResolved ,
1110 TableState ,
1211} from '@tanstack/table-core'
1312
@@ -41,26 +40,24 @@ export function injectTable<
4140
4241 // Compose table options using computed.
4342 // This is to allow `tableSignal` to listen and set table option
44- const updatedOptions = computed < TableOptionsResolved < TFeatures , TData > > (
45- ( ) => {
46- // listen to table state changed
47- const tableState = state ( )
48- // listen to input options changed
49- const tableOptions = options ( )
50- return {
51- ...table . options ,
52- ...resolvedOptions ,
53- ...tableOptions ,
54- state : { ...tableState , ...tableOptions . state } ,
55- onStateChange : ( updater ) => {
56- const value =
57- updater instanceof Function ? updater ( tableState ) : updater
58- state . set ( value )
59- resolvedOptions . onStateChange ( updater )
60- } ,
61- }
62- } ,
63- )
43+ const updatedOptions = computed < TableOptions < TFeatures , TData > > ( ( ) => {
44+ // listen to table state changed
45+ const tableState = state ( )
46+ // listen to input options changed
47+ const tableOptions = options ( )
48+ return {
49+ ...table . options ,
50+ ...resolvedOptions ,
51+ ...tableOptions ,
52+ state : { ...tableState , ...tableOptions . state } ,
53+ onStateChange : ( updater ) => {
54+ const value =
55+ updater instanceof Function ? updater ( tableState ) : updater
56+ state . set ( value )
57+ resolvedOptions . onStateChange ( updater )
58+ } ,
59+ }
60+ } )
6461
6562 // convert table instance to signal for proxify to listen to any table state and options changes
6663 const tableSignal = computed (
0 commit comments