@tanstack/table-core 8.1.2 → 8.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/table-core",
3
3
  "author": "Tanner Linsley",
4
- "version": "8.1.2",
4
+ "version": "8.1.4",
5
5
  "description": "Headless UI for building powerful tables & datagrids for TS/JS.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/tanstack/table#readme",
package/src/utils.ts CHANGED
@@ -27,9 +27,12 @@ export function noop() {
27
27
  //
28
28
  }
29
29
 
30
- export function makeStateUpdater(key: keyof TableState, table: unknown) {
31
- return (updater: Updater<any>) => {
32
- ;(table as any).setState(<TTableState>(old: TTableState) => {
30
+ export function makeStateUpdater<K extends keyof TableState>(
31
+ key: K,
32
+ instance: unknown
33
+ ) {
34
+ return (updater: Updater<TableState[K]>) => {
35
+ ;(instance as any).setState(<TTableState>(old: TTableState) => {
33
36
  return {
34
37
  ...old,
35
38
  [key]: functionalUpdate(updater, (old as any)[key]),