@createstore/createstore 1.1.1 → 1.1.2
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
CHANGED
|
@@ -8,6 +8,16 @@ npm install @createstore/createstore
|
|
|
8
8
|
|
|
9
9
|
Requires React 19 or newer. Works in the browser, in Node, and with Next.js Server Components.
|
|
10
10
|
|
|
11
|
+
Not related to Redux's `createStore` function: this is a separate library, installed as `@createstore/createstore`.
|
|
12
|
+
|
|
13
|
+
## When to use it
|
|
14
|
+
|
|
15
|
+
- **Use it** when several components share state and you want the `useState` shape without a provider or reducers,
|
|
16
|
+
and when you also need server data, saved state, undo, tab sync or offline support behind the same API.
|
|
17
|
+
- **It is fastest** when many components read different keys, because only readers of a changed key re-render.
|
|
18
|
+
- **Look elsewhere** if you need to support React 18 or older, or if every component re-renders on every change
|
|
19
|
+
(Zustand is faster there; see `bench/`).
|
|
20
|
+
|
|
11
21
|
## Quick start
|
|
12
22
|
|
|
13
23
|
```tsx
|