Skip to content

Commit 79e5e32

Browse files
authored
docs: remove core store from examples and add react-scan to react example (#172)
* examples(all): remove core store from examples. Import Store from framework adpaters. Add react-scan to react example * consistent comments
1 parent de6708e commit 79e5e32

File tree

18 files changed

+296
-127
lines changed

18 files changed

+296
-127
lines changed

docs/framework/angular/quick-start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ export class AppComponent {}
3232

3333
**store.ts**
3434
```typescript
35-
import { Store } from '@tanstack/store';
35+
import { Store } from '@tanstack/angular-store';
3636

37-
// You can use @tanstack/store outside of App components too!
37+
// You can instantiate the store outside of Angular components too!
3838
export const store = new Store({
3939
dogs: 0,
4040
cats: 0,

docs/framework/react/quick-start.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ The basic react app example to get started with the TanStack react-store.
88
```tsx
99
import React from "react";
1010
import ReactDOM from "react-dom/client";
11-
import { useStore } from "@tanstack/react-store";
12-
import { Store } from "@tanstack/store";
11+
import { Store, useStore } from "@tanstack/react-store";
1312

14-
// You can use @tanstack/store outside of React components too!
13+
// You can instantiate the store outside of React components too!
1514
export const store = new Store({
1615
dogs: 0,
1716
cats: 0,
@@ -55,5 +54,4 @@ function App() {
5554
const root = ReactDOM.createRoot(document.getElementById("root"));
5655
root.render(<App />);
5756

58-
5957
```

docs/framework/solid/quick-start.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ id: quick-start
66
The basic Solid app example to get started with the TanStack Solid-store.
77

88
```jsx
9-
import { useStore, Store } from '@tanstack/solid-store';
9+
import { Store, useStore } from '@tanstack/solid-store';
1010

11+
// You can instantiate the store outside of Solid components too!
1112
export const store = new Store({
1213
  cats: 0,
1314
  dogs: 0

docs/framework/svelte/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The basic Svelte app example to get started with the TanStack svelte-store.
99
```ts
1010
import { Store } from '@tanstack/svelte-store';
1111

12-
// You can use @tanstack/svelte-store outside of Svelte files too!
12+
// You can instantiate the store outside of Svelte files too!
1313
export const store = new Store({
1414
dogs: 0,
1515
cats: 0,

docs/framework/vue/quick-start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import Display from './Display.vue';
2424

2525
**store.js**
2626
```js
27-
import { Store } from '@tanstack/store';
27+
import { Store } from '@tanstack/vue-store';
2828

29-
// You can use @tanstack/store outside of Vue components too!
29+
// You can instantiate the store outside of Vue components too!
3030
export const store = new Store({
3131
dogs: 0,
3232
cats: 0,

examples/angular/simple/angular.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,8 @@
7474
}
7575
}
7676
}
77+
},
78+
"cli": {
79+
"analytics": false
7780
}
7881
}

examples/angular/simple/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"@angular/platform-browser-dynamic": "^19.2.0",
1919
"@angular/router": "^19.2.0",
2020
"@tanstack/angular-store": "^0.7.0",
21-
"@tanstack/store": "^0.7.0",
2221
"rxjs": "^7.8.2",
2322
"tslib": "^2.8.1",
2423
"zone.js": "^0.15.0"

examples/angular/simple/src/app/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Store } from '@tanstack/store'
1+
import { Store } from '@tanstack/angular-store'
22

3-
// You can use @tanstack/store outside of App components too!
3+
// You can instantiate a Store outside of Angular components too!
44
export const store = new Store({
55
dogs: 0,
66
cats: 0,

examples/react/simple/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
},
1111
"dependencies": {
1212
"@tanstack/react-store": "^0.7.0",
13-
"@tanstack/store": "^0.7.0",
1413
"react": "^18.3.1",
1514
"react-dom": "^18.3.1"
1615
},
1716
"devDependencies": {
1817
"@types/react": "^18.3.3",
1918
"@types/react-dom": "^18.3.0",
2019
"@vitejs/plugin-react": "^4.3.4",
20+
"react-scan": "^0.2.12",
2121
"vite": "^6.1.1"
2222
},
2323
"browserslist": {

examples/react/simple/src/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { scan } from 'react-scan' // dev-tools for demo
12
import ReactDOM from 'react-dom/client'
2-
import { useStore } from '@tanstack/react-store'
3-
import { Store } from '@tanstack/store'
3+
import { Store, useStore } from '@tanstack/react-store'
44

5-
// You can use @tanstack/store outside of React components too!
5+
// You can use instantiate a Store outside of React components too!
66
export const store = new Store({
77
dogs: 0,
88
cats: 0,
@@ -53,3 +53,5 @@ function App() {
5353

5454
const root = ReactDOM.createRoot(document.getElementById('root')!)
5555
root.render(<App />)
56+
57+
scan()

0 commit comments

Comments
 (0)