@octanejs/zustand 0.1.51 → 0.1.52

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.
Files changed (2) hide show
  1. package/README.md +3 -10
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -57,8 +57,9 @@ hook used twice) stay independent, exactly like in React.
57
57
  ## Selecting object slices — `useShallow`
58
58
 
59
59
  A selector that returns a fresh object/array each call (`(s) => ({ a: s.a })`) never
60
- compares Object.is-equal, so it re-renders on every store change. Wrap it with
61
- `useShallow` to compare by shallow equality:
60
+ compares Object.is-equal, so it violates `useSyncExternalStore` snapshot stability
61
+ and reaches the maximum update depth guard. Wrap it with `useShallow` to cache
62
+ the selection by shallow equality:
62
63
 
63
64
  ```tsx
64
65
  import { useShallow } from '@octanejs/zustand/shallow';
@@ -69,14 +70,6 @@ function Sliced() @{
69
70
  }
70
71
  ```
71
72
 
72
- ## Divergences from React
73
-
74
- - **Unstable selectors don't loop.** React's `useSyncExternalStore` throws the dev
75
- warning _"The result of getSnapshot should be cached"_ and re-renders in a loop when
76
- a selector returns a new reference every render. octane settles after a bounded
77
- number of renders instead — no loop, no warning. Prefer `useShallow` regardless, for
78
- the same reason you would in React (avoid the extra renders).
79
-
80
73
  ## Equality functions — `traditional`
81
74
 
82
75
  For the equality-fn pattern, `@octanejs/zustand/traditional` provides
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/zustand",
3
- "version": "0.1.51",
3
+ "version": "0.1.52",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -48,12 +48,12 @@
48
48
  "octane": "^0.1.51 || ^0.2.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@tsrx/react": "^0.2.63",
51
+ "@tsrx/react": "^0.2.67",
52
52
  "esbuild": "^0.28.1",
53
- "react": "^19.2.7",
54
- "react-dom": "^19.2.7",
53
+ "react": "19.2.7",
54
+ "react-dom": "19.2.7",
55
55
  "vitest": "^4.1.10",
56
- "octane": "0.2.0"
56
+ "octane": "0.2.5"
57
57
  },
58
58
  "scripts": {
59
59
  "test": "vitest run"