@instantdb/core
Advanced tools
Comparing version 0.12.36 to 0.12.37
@@ -10,3 +10,6 @@ /** | ||
status: string; | ||
querySubs: any; | ||
/** @type {PersistedObject} */ | ||
querySubs: PersistedObject; | ||
/** @type {PersistedObject} */ | ||
pendingMutations: PersistedObject; | ||
queryCbs: {}; | ||
@@ -18,3 +21,2 @@ authCbs: any[]; | ||
_persister: any; | ||
pendingMutations: any; | ||
mutationDeferredStore: Map<any, any>; | ||
@@ -128,2 +130,3 @@ _reconnectTimeoutId: any; | ||
notifyAll(): void; | ||
loadedNotifyAll(): void; | ||
/** Applies transactions locally and sends transact message to server */ | ||
@@ -285,4 +288,5 @@ pushTx: (chunks: any) => Promise<any>; | ||
} | ||
import { PersistedObject } from "./utils/PersistedObject"; | ||
import IndexedDBStorage from "./IndexedDBStorage"; | ||
import WindowNetworkListener from "./WindowNetworkListener"; | ||
//# sourceMappingURL=Reactor.d.ts.map |
@@ -116,3 +116,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
this.querySubs.set((_) => ret); | ||
this.notifyAll(); | ||
this.loadedNotifyAll(); | ||
}; | ||
@@ -126,2 +126,3 @@ /** | ||
this.pendingMutations.set((_) => ret); | ||
this.loadedNotifyAll(); | ||
const rewrittenStorageMuts = this._rewriteMutations(this.attrs, storageMuts); | ||
@@ -698,2 +699,7 @@ rewrittenStorageMuts.forEach((mut, k) => { | ||
} | ||
loadedNotifyAll() { | ||
if (this.pendingMutations.isLoading() || this.querySubs.isLoading()) | ||
return; | ||
this.notifyAll(); | ||
} | ||
shutdown() { | ||
@@ -700,0 +706,0 @@ this._isShutdown = true; |
@@ -15,2 +15,3 @@ export class PersistedObject { | ||
waitForLoaded(): Promise<void>; | ||
isLoading(): boolean; | ||
waitForSync(): Promise<void>; | ||
@@ -17,0 +18,0 @@ _writeToStorage(): void; |
@@ -63,2 +63,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
isLoading() { | ||
return this._isLoading; | ||
} | ||
waitForSync() { | ||
@@ -65,0 +68,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -10,3 +10,6 @@ /** | ||
status: string; | ||
querySubs: any; | ||
/** @type {PersistedObject} */ | ||
querySubs: PersistedObject; | ||
/** @type {PersistedObject} */ | ||
pendingMutations: PersistedObject; | ||
queryCbs: {}; | ||
@@ -18,3 +21,2 @@ authCbs: any[]; | ||
_persister: any; | ||
pendingMutations: any; | ||
mutationDeferredStore: Map<any, any>; | ||
@@ -128,2 +130,3 @@ _reconnectTimeoutId: any; | ||
notifyAll(): void; | ||
loadedNotifyAll(): void; | ||
/** Applies transactions locally and sends transact message to server */ | ||
@@ -285,4 +288,5 @@ pushTx: (chunks: any) => Promise<any>; | ||
} | ||
import { PersistedObject } from "./utils/PersistedObject"; | ||
import IndexedDBStorage from "./IndexedDBStorage"; | ||
import WindowNetworkListener from "./WindowNetworkListener"; | ||
//# sourceMappingURL=Reactor.d.ts.map |
@@ -144,3 +144,3 @@ "use strict"; | ||
this.querySubs.set((_) => ret); | ||
this.notifyAll(); | ||
this.loadedNotifyAll(); | ||
}; | ||
@@ -154,2 +154,3 @@ /** | ||
this.pendingMutations.set((_) => ret); | ||
this.loadedNotifyAll(); | ||
const rewrittenStorageMuts = this._rewriteMutations(this.attrs, storageMuts); | ||
@@ -726,2 +727,7 @@ rewrittenStorageMuts.forEach((mut, k) => { | ||
} | ||
loadedNotifyAll() { | ||
if (this.pendingMutations.isLoading() || this.querySubs.isLoading()) | ||
return; | ||
this.notifyAll(); | ||
} | ||
shutdown() { | ||
@@ -728,0 +734,0 @@ this._isShutdown = true; |
@@ -15,2 +15,3 @@ export class PersistedObject { | ||
waitForLoaded(): Promise<void>; | ||
isLoading(): boolean; | ||
waitForSync(): Promise<void>; | ||
@@ -17,0 +18,0 @@ _writeToStorage(): void; |
@@ -66,2 +66,5 @@ "use strict"; | ||
} | ||
isLoading() { | ||
return this._isLoading; | ||
} | ||
waitForSync() { | ||
@@ -68,0 +71,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "@instantdb/core", | ||
"version": "v0.12.36", | ||
"version": "v0.12.37", | ||
"description": "Instant's core local abstraction", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -57,3 +57,8 @@ // @ts-check | ||
status = STATUS.CONNECTING; | ||
/** @type {PersistedObject} */ | ||
querySubs; | ||
/** @type {PersistedObject} */ | ||
pendingMutations; | ||
queryCbs = {}; | ||
@@ -65,3 +70,2 @@ authCbs = []; | ||
_persister; | ||
pendingMutations; | ||
mutationDeferredStore = new Map(); | ||
@@ -251,3 +255,3 @@ _reconnectTimeoutId = null; | ||
this.notifyAll(); | ||
this.loadedNotifyAll(); | ||
}; | ||
@@ -262,2 +266,3 @@ | ||
this.pendingMutations.set((_) => ret); | ||
this.loadedNotifyAll(); | ||
const rewrittenStorageMuts = this._rewriteMutations( | ||
@@ -733,2 +738,8 @@ this.attrs, | ||
loadedNotifyAll() { | ||
if (this.pendingMutations.isLoading() || this.querySubs.isLoading()) return; | ||
this.notifyAll(); | ||
} | ||
/** Applies transactions locally and sends transact message to server */ | ||
@@ -1227,3 +1238,3 @@ pushTx = (chunks) => { | ||
}); | ||
} catch (e) { } | ||
} catch (e) {} | ||
} | ||
@@ -1230,0 +1241,0 @@ |
@@ -65,2 +65,6 @@ // PersistedObjects save data outside of memory. | ||
isLoading() { | ||
return this._isLoading; | ||
} | ||
async waitForSync() { | ||
@@ -67,0 +71,0 @@ if (!this._nextSave) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
2003421
40848