@anfenn/zync 0.1.22 → 0.1.23

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 +4 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -242,23 +242,19 @@ async function firstLoad(lastId: any) {
242
242
 
243
243
  ## Optional IndexedDB storage
244
244
 
245
- When using IndexedDB Zustand saves the whole store under one key, which means indexes cannot be used to accelerate querying. However, if this becomes a performance issue due to the size of the store, then libraries like dexie.js instead of Zustand would be a better solution and provide the syntax for high performance queries.
245
+ Using async IndexedDB over sync localStorage gives the advantage of a responsive UI when reading/writing a very large store, as IndexedDB is running in it's own thread.
246
246
 
247
247
  If you want to use the bundled `createIndexedDBStorage()` helper, install `idb` in your project. It's intentionally optional so projects that don't use IndexedDB won't pull the dependency into their bundles.
248
248
 
249
- Install for runtime usage:
249
+ [idb](https://www.npmjs.com/package/idb) is an extremely popular and lightweight wrapper to simplify IndexedDB's verbose events based api into a simple Promise based one. It also handles the inconsistencies found when running in different browsers.
250
250
 
251
251
  ```bash
252
252
  npm install idb
253
253
  ```
254
254
 
255
- Or add it as an optional dependency of your package:
256
-
257
- ```bash
258
- npm install --save-optional idb
259
- ```
255
+ When using IndexedDB Zustand saves the whole store under one key, which means indexes cannot be used to accelerate querying. However, if this becomes a performance issue due to the size of the store, then libraries like dexie.js instead of Zustand would be a better solution and provide the syntax for high performance queries.
260
256
 
261
- The library will throw a helpful runtime error if `idb` isn't installed when `createIndexedDBStorage()` is invoked.
257
+ From testing I've found Zustand and Zync are lightening fast even with 100,000 average sized state objects.
262
258
 
263
259
  ## Community
264
260
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anfenn/zync",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "private": false,
5
5
  "description": "Sync middleware for Zustand",
6
6
  "keywords": [],