@procedures/store 0.17.3 → 0.17.4
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/CHANGELOG.md +20 -0
- package/README.md +58 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/browser.d.ts +4 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +3 -0
- package/dist/browser.js.map +1 -1
- package/dist/storage/hybrid.d.ts +9 -0
- package/dist/storage/hybrid.d.ts.map +1 -1
- package/dist/storage/hybrid.js +14 -0
- package/dist/storage/hybrid.js.map +1 -1
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +2 -0
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/tab-coordinator.d.ts +284 -0
- package/dist/storage/tab-coordinator.d.ts.map +1 -0
- package/dist/storage/tab-coordinator.js +584 -0
- package/dist/storage/tab-coordinator.js.map +1 -0
- package/package.json +5 -5
- package/src/browser.ts +11 -0
- package/src/storage/hybrid.ts +14 -0
- package/src/storage/index.ts +10 -0
- package/src/storage/tab-coordinator.ts +692 -0
package/src/storage/hybrid.ts
CHANGED
|
@@ -1993,6 +1993,20 @@ export class HybridStorage<T> implements CollectionStorage<T> {
|
|
|
1993
1993
|
return this.syncToRemote();
|
|
1994
1994
|
}
|
|
1995
1995
|
|
|
1996
|
+
/**
|
|
1997
|
+
* This method resolves when the queue store holds the operations that the queue has at the call
|
|
1998
|
+
* (roadmap CLI-25): the loaded queue, the captured changes and the queued writes. It sends
|
|
1999
|
+
* nothing to the remote. A failed write of the store resolves it too, and the status keeps the
|
|
2000
|
+
* failure. A `TabCoordinator` acknowledges the batches of another tab after it.
|
|
2001
|
+
*
|
|
2002
|
+
* @throws The error of the load, when the storage could not load its queue
|
|
2003
|
+
*/
|
|
2004
|
+
async whenQueued(): Promise<void> {
|
|
2005
|
+
await this.loaded;
|
|
2006
|
+
if (this.loadError) throw this.loadError;
|
|
2007
|
+
await this.storeChain;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
1996
2010
|
/**
|
|
1997
2011
|
* Force a full sync (both directions).
|
|
1998
2012
|
*/
|
package/src/storage/index.ts
CHANGED
|
@@ -48,6 +48,16 @@ export {
|
|
|
48
48
|
SyncStateError,
|
|
49
49
|
} from "./hybrid.js";
|
|
50
50
|
export type { HybridStorageOptions, HybridMode, LocalCopyStorage } from "./hybrid.js";
|
|
51
|
+
// One leader tab runs the sync, and the other tabs copy its changes (roadmap CLI-25)
|
|
52
|
+
export { TabCoordinator } from "./tab-coordinator.js";
|
|
53
|
+
export type {
|
|
54
|
+
TabAbortSignalLike,
|
|
55
|
+
TabChannelFactory,
|
|
56
|
+
TabChannelLike,
|
|
57
|
+
TabCoordinatorOptions,
|
|
58
|
+
TabLockManagerLike,
|
|
59
|
+
TabRole,
|
|
60
|
+
} from "./tab-coordinator.js";
|
|
51
61
|
// The push feed of the remote changes (roadmap CLI-21, CLI-15)
|
|
52
62
|
export { EventsChangeFeed } from "./feed.js";
|
|
53
63
|
export type {
|