apical-store
Advanced tools
Comparing version 0.0.72 to 0.0.73
@@ -810,2 +810,3 @@ (function (global, factory) { | ||
this.$$changes = []; | ||
this.$$loaded = false; | ||
this.$$debounceRate = 100; | ||
@@ -895,2 +896,3 @@ this.$$lastProcessChanges = 0; | ||
o.splice(0, o.length, ...deserialized); | ||
this.$$loaded = true; | ||
}); | ||
@@ -1158,2 +1160,12 @@ }); | ||
} | ||
get loaded() { | ||
return new Promise((resolve) => { | ||
let i = setInterval(() => { | ||
if (this.$$loaded) { | ||
clearInterval(i); | ||
resolve(); | ||
} | ||
}, 100); | ||
}); | ||
} | ||
} | ||
@@ -1160,0 +1172,0 @@ |
@@ -11,3 +11,3 @@ import { LocalPersistence } from "./persistence/local"; | ||
private $$changes; | ||
private $$token; | ||
private $$loaded; | ||
private $$localPersistence; | ||
@@ -103,2 +103,3 @@ private $$remotePersistence; | ||
isUpdated(): Promise<boolean>; | ||
get loaded(): Promise<void>; | ||
} |
@@ -21,2 +21,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
this.$$changes = []; | ||
this.$$loaded = false; | ||
this.$$debounceRate = 100; | ||
@@ -106,2 +107,3 @@ this.$$lastProcessChanges = 0; | ||
o.splice(0, o.length, ...deserialized); | ||
this.$$loaded = true; | ||
}); | ||
@@ -369,2 +371,12 @@ }); | ||
} | ||
get loaded() { | ||
return new Promise((resolve) => { | ||
let i = setInterval(() => { | ||
if (this.$$loaded) { | ||
clearInterval(i); | ||
resolve(); | ||
} | ||
}, 100); | ||
}); | ||
} | ||
} |
{ | ||
"name": "apical-store", | ||
"version": "0.0.72", | ||
"version": "0.0.73", | ||
"description": "Mobx-Syncable-IndexedDB", | ||
@@ -5,0 +5,0 @@ "main": "dist/bundle.js", |
@@ -7,5 +7,3 @@ import { Change, Observable } from "./observable"; | ||
export class Store< | ||
T extends Document, | ||
> { | ||
export class Store<T extends Document> { | ||
public isOnline = true; | ||
@@ -17,3 +15,3 @@ public deferredPresent: boolean = false; | ||
private $$changes: Change<T[]>[] = []; | ||
private $$token: string | undefined; | ||
private $$loaded: boolean = false; | ||
private $$localPersistence: LocalPersistence | undefined; | ||
@@ -123,2 +121,3 @@ private $$remotePersistence: RemotePersistence | undefined; | ||
o.splice(0, o.length, ...deserialized); | ||
this.$$loaded = true; | ||
}); | ||
@@ -149,3 +148,3 @@ } | ||
} | ||
await this.$$localPersistence.put(toWrite); | ||
@@ -385,4 +384,3 @@ let deferredArray = await this.$$localPersistence.getDeferred(); | ||
new = this.$$model.new | ||
new = this.$$model.new; | ||
@@ -434,2 +432,13 @@ delete(item: T) { | ||
} | ||
} | ||
get loaded() { | ||
return new Promise<void>((resolve) => { | ||
let i = setInterval(() => { | ||
if (this.$$loaded) { | ||
clearInterval(i); | ||
resolve(); | ||
} | ||
}, 100); | ||
}); | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
246179
6669