@t8/react-store 1.2.7 → 1.2.9
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/README.md +2 -8
- package/package.json +45 -45
package/README.md
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
# T8 React Store
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React app state management condensed to the essentials
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
**Why?** To get the shortest migration path from local state to shared state and a quick way to set up shared state from scratch, whether with SSR or without. Other approaches, like Redux Toolkit, Zustand, Jotai, MobX, depart from this picture to varying degrees.
|
|
8
|
-
|
|
9
|
-
This picture is achieved here by (1) having a simple API introducing as few new entities as possible, (2) closely following the React's `useState()` pattern of initializing and manipulating the state to avoid boilerplate and sizable rewrites with the common task of migration from local state to shared state, (3) working smoothly with SSR with regular React Contexts without requiring a specifically designed setup and without internally making use of global stores or other global variables by default.
|
|
5
|
+
**Features:** Quickest migration from local state · Single pattern for shared and local state · CSR/SSR without workarounds · Integrable with Immer · Quickly pluggable persistence across page reloads
|
|
10
6
|
|
|
11
7
|
<!-- docsgen-show-start --
|
|
12
8
|
```diff
|
|
@@ -25,8 +21,6 @@ This picture is achieved here by (1) having a simple API introducing as few new
|
|
|
25
21
|
```
|
|
26
22
|
-- docsgen-show-end -->
|
|
27
23
|
|
|
28
|
-
Installation: `npm i @t8/react-store`
|
|
29
|
-
|
|
30
24
|
## Shared state setup
|
|
31
25
|
|
|
32
26
|
Moving local state to the full-fledged shared state:
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@t8/react-store",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "./dist/index.cjs",
|
|
6
|
-
"module": "./dist/index.mjs",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"demo": "npx @t8/serve
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
},
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/t8js/react-store.git"
|
|
19
|
-
},
|
|
20
|
-
"homepage": "https://t8.js.org/react-store",
|
|
21
|
-
"keywords": [
|
|
22
|
-
"react",
|
|
23
|
-
"state management",
|
|
24
|
-
"shared state",
|
|
25
|
-
"global state",
|
|
26
|
-
"store"
|
|
27
|
-
],
|
|
28
|
-
"author": "axtk",
|
|
29
|
-
"license": "MIT",
|
|
30
|
-
"peerDependencies": {
|
|
31
|
-
"react": ">=16.8"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@playwright/test": "^1.56.0",
|
|
35
|
-
"@t8/serve": "^0.
|
|
36
|
-
"@types/node": "^24.5.2",
|
|
37
|
-
"@types/react": "^19.2.
|
|
38
|
-
"@types/react-dom": "^19.2.3",
|
|
39
|
-
"immer": "^11.
|
|
40
|
-
"react-dom": "^19.2.3"
|
|
41
|
-
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"@t8/store": "^1.4.
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@t8/react-store",
|
|
3
|
+
"version": "1.2.9",
|
|
4
|
+
"description": "React app state management condensed to the essentials",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"demo": "npx @t8/serve tests/counter --spa -b src/index.tsx",
|
|
11
|
+
"demo-t3": "npx @t8/serve tests/tic-tac-toe --spa -b src/index.tsx",
|
|
12
|
+
"preversion": "npx npm-run-all shape test",
|
|
13
|
+
"shape": "npx codeshape",
|
|
14
|
+
"test": "npx playwright test --project=chromium"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/t8js/react-store.git"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://t8.js.org/react-store",
|
|
21
|
+
"keywords": [
|
|
22
|
+
"react",
|
|
23
|
+
"state management",
|
|
24
|
+
"shared state",
|
|
25
|
+
"global state",
|
|
26
|
+
"store"
|
|
27
|
+
],
|
|
28
|
+
"author": "axtk",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"react": ">=16.8"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@playwright/test": "^1.56.0",
|
|
35
|
+
"@t8/serve": "^0.2.0",
|
|
36
|
+
"@types/node": "^24.5.2",
|
|
37
|
+
"@types/react": "^19.2.9",
|
|
38
|
+
"@types/react-dom": "^19.2.3",
|
|
39
|
+
"immer": "^11.1.3",
|
|
40
|
+
"react-dom": "^19.2.3"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@t8/store": "^1.4.1"
|
|
44
|
+
}
|
|
45
|
+
}
|