@anfenn/zync 0.1.19 → 0.1.20

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 +2 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -56,6 +56,7 @@ export const useStore = create<any>()(
56
56
  facts: [...state.facts, newItem],
57
57
  }));
58
58
 
59
+ // Never call queueToSync() inside Zustand set() due to itself calling set(), so may cause lost state changes
59
60
  queueToSync(SyncAction.CreateOrUpdate, item._localId, 'facts');
60
61
  },
61
62
  updateFact: (localId: string, changes: Partial<Fact>) => {
@@ -121,7 +122,7 @@ const syncState = useStore((state) => state.syncState);
121
122
  // syncState.lastPulled
122
123
 
123
124
  // Zync's control api
124
- useStore.sync.enable(true | false);
125
+ useStore.sync.enable(true | false); // Defaults to false, so turn on to start syncing
125
126
  useStore.sync.startFirstLoad();
126
127
  ```
127
128
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anfenn/zync",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "private": false,
5
5
  "description": "Sync middleware for Zustand",
6
6
  "keywords": [],