Skip to content

Commit 86199dc

Browse files
committed
feat: update @tanstack/store to v9
1 parent ffde8d8 commit 86199dc

23 files changed

Lines changed: 114 additions & 119 deletions

File tree

examples/react/basic-external-state/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@faker-js/faker": "^10.2.0",
15-
"@tanstack/react-store": "^0.8.0",
15+
"@tanstack/react-store": "^0.9.1",
1616
"@tanstack/react-table": "^9.0.0-alpha.11",
1717
"react": "^19.2.4",
1818
"react-dom": "^19.2.4"

examples/react/basic-external-store/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@faker-js/faker": "^10.2.0",
15-
"@tanstack/react-store": "^0.8.0",
15+
"@tanstack/react-store": "^0.9.1",
1616
"@tanstack/react-table": "^9.0.0-alpha.11",
1717
"react": "^19.2.4",
1818
"react-dom": "^19.2.4"

examples/react/basic-external-store/src/main.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import ReactDOM from 'react-dom/client'
33
import './index.css'
4-
import { Store, useStore } from '@tanstack/react-store'
4+
import { createStore, useStore } from '@tanstack/react-store'
55
import {
66
createColumnHelper,
77
createPaginatedRowModel,
@@ -60,18 +60,17 @@ function App() {
6060
const rerender = React.useReducer(() => ({}), {})[1]
6161

6262
// create our own TanStack Store in our own scope (This could just be a global store if defined outside of this component)
63-
const [myTableStore] = React.useState(
64-
() =>
65-
new Store(
66-
getInitialTableState(
67-
_features, // get default initial state from features
68-
// custom initial state
69-
{
70-
sorting: [],
71-
pagination: { pageIndex: 0, pageSize: 10 },
72-
},
73-
),
63+
const [myTableStore] = React.useState(() =>
64+
createStore(
65+
getInitialTableState(
66+
_features, // get default initial state from features
67+
// custom initial state
68+
{
69+
sorting: [],
70+
pagination: { pageIndex: 0, pageSize: 10 },
71+
},
7472
),
73+
),
7574
)
7675

7776
// Subscribe to store state for reactive updates, custom selector available too

examples/react/composable-tables/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@faker-js/faker": "^10.2.0",
15-
"@tanstack/react-store": "^0.8.0",
15+
"@tanstack/react-store": "^0.9.1",
1616
"@tanstack/react-table": "^9.0.0-alpha.11",
1717
"react": "^19.2.4",
1818
"react-dom": "^19.2.4"

examples/react/pagination/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@faker-js/faker": "^10.2.0",
15-
"@tanstack/react-store": "^0.8.0",
15+
"@tanstack/react-store": "^0.9.1",
1616
"@tanstack/react-table": "^9.0.0-alpha.11",
1717
"react": "^19.2.4",
1818
"react-dom": "^19.2.4"

examples/react/row-selection/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@faker-js/faker": "^10.2.0",
15-
"@tanstack/react-store": "^0.8.0",
15+
"@tanstack/react-store": "^0.9.1",
1616
"@tanstack/react-table": "^9.0.0-alpha.11",
1717
"react": "^19.2.4",
1818
"react-dom": "^19.2.4"

examples/react/with-tanstack-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"dependencies": {
1414
"@faker-js/faker": "^10.2.0",
1515
"@tanstack/react-query": "^5.90.20",
16-
"@tanstack/react-store": "^0.8.0",
16+
"@tanstack/react-store": "^0.9.1",
1717
"@tanstack/react-table": "^9.0.0-alpha.11",
1818
"react": "^19.2.4",
1919
"react-dom": "^19.2.4"

examples/react/with-tanstack-query/src/main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
keepPreviousData,
77
useQuery,
88
} from '@tanstack/react-query'
9-
import { Store, useStore } from '@tanstack/react-store'
9+
import { createStore, useStore } from '@tanstack/react-store'
1010
import './index.css'
1111
import {
1212
createColumnHelper,
@@ -49,7 +49,7 @@ const columns = columnHelper.columns([
4949
}),
5050
])
5151

52-
const myTableStore = new Store(
52+
const myTableStore = createStore(
5353
getInitialTableState(_features, {
5454
pagination: { pageIndex: 0, pageSize: 10 },
5555
}),

packages/angular-table/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"test:types": "tsc && vitest --typecheck"
5252
},
5353
"dependencies": {
54-
"@tanstack/angular-store": "^0.8.0",
54+
"@tanstack/angular-store": "^0.9.1",
5555
"@tanstack/table-core": "workspace:*",
5656
"tslib": "^2.8.1"
5757
},

packages/angular-table/src/injectTable.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
Injector,
33
assertInInjectionContext,
44
computed,
5-
effect,
65
inject,
76
untracked,
87
} from '@angular/core'
@@ -134,14 +133,6 @@ export function injectTable<
134133
return result
135134
})
136135

137-
effect(
138-
(onCleanup) => {
139-
const cleanup = table.store.mount()
140-
onCleanup(() => cleanup())
141-
},
142-
{ injector },
143-
)
144-
145136
const tableState = injectStore(
146137
table.store,
147138
(state: TableState<TFeatures>) => state,

0 commit comments

Comments
 (0)