badmfck-api-server 1.7.6 → 1.7.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -24,6 +24,20 @@ class DataProvider {
|
|
24
24
|
if (!this.name)
|
25
25
|
this.name = "DataProvider " + (DataProvider.nextID++);
|
26
26
|
}
|
27
|
+
async forceUpdate() {
|
28
|
+
if (this.busy)
|
29
|
+
return;
|
30
|
+
this.wasError = false;
|
31
|
+
this.lastRequestTime = 0;
|
32
|
+
await this.getData();
|
33
|
+
}
|
34
|
+
localUpdate(data) {
|
35
|
+
if (this.busy)
|
36
|
+
return;
|
37
|
+
this.wasError = false;
|
38
|
+
this.lastRequestTime = +new Date();
|
39
|
+
this.data = data;
|
40
|
+
}
|
27
41
|
async getData() {
|
28
42
|
if (this.busy)
|
29
43
|
return new Promise((resolve, reject) => this.callbacks.subscribe((d) => resolve(d)));
|