zustand-lite 0.4.2 → 0.5.0
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 +19 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -194,6 +194,22 @@ function Component() {
|
|
|
194
194
|
}
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
+
### Multi selectors
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
const initialState = {
|
|
201
|
+
a: 'a', b: 'b', c: 'c', d: 'd',
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export const store = createStore(initialState)
|
|
205
|
+
|
|
206
|
+
// Listen to multiple properties of the store at the same time
|
|
207
|
+
// for maximal brevity.
|
|
208
|
+
function Component() {
|
|
209
|
+
const { a, c } = store.use(['a', 'c'])
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
197
213
|
### Setting whole state
|
|
198
214
|
|
|
199
215
|
```ts
|
|
@@ -372,7 +388,9 @@ You can enable the most useful middlewares:
|
|
|
372
388
|
- Ability to specify equality function for extended getters. It's possible now, but requires to
|
|
373
389
|
import hook from 'zustand' package, which is suboptimal **(available from version 3.0.0 with
|
|
374
390
|
use() function or deep auto-generated selectors. Still no possible for custom getters)**.
|
|
375
|
-
|
|
391
|
+
- Extend state option, to add additional state to the store than can be adjusted in setters and
|
|
392
|
+
getters.
|
|
393
|
+
- Higher order automatic devtools messages.
|
|
376
394
|
|
|
377
395
|
## 🧱 Built With
|
|
378
396
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zustand-lite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Zustand Lite builds upon zustand, by auto-generating selectors and simplifying API even more.",
|
|
5
5
|
"author": "Piotr Siatkowski <p.siatkowski@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"sideEffects": false,
|
|
25
25
|
"type": "module",
|
|
26
|
+
"main": "dist/index.cjs",
|
|
27
|
+
"module": "dist/index.js",
|
|
28
|
+
"types": "dist/index.d.ts",
|
|
26
29
|
"files": [
|
|
27
30
|
"dist/**/*"
|
|
28
31
|
],
|