@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.
- package/README.md +2 -1
- 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
|
|