sliftutils 0.63.0 → 0.64.0
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/index.d.ts
CHANGED
|
@@ -599,6 +599,7 @@ declare module "sliftutils/storage/DelayedStorage" {
|
|
|
599
599
|
lastModified: number;
|
|
600
600
|
} | undefined>;
|
|
601
601
|
reset(): Promise<void>;
|
|
602
|
+
watchResync(callback: () => void): void;
|
|
602
603
|
}
|
|
603
604
|
|
|
604
605
|
}
|
|
@@ -890,6 +891,7 @@ declare module "sliftutils/storage/PendingStorage" {
|
|
|
890
891
|
private watchPending;
|
|
891
892
|
private updatePending;
|
|
892
893
|
reset(): Promise<void>;
|
|
894
|
+
watchResync(callback: () => void): void;
|
|
893
895
|
}
|
|
894
896
|
|
|
895
897
|
}
|
package/package.json
CHANGED
|
@@ -27,4 +27,9 @@ export class DelayedStorage<T> implements IStorage<T> {
|
|
|
27
27
|
const storage = await this.storage;
|
|
28
28
|
return storage.reset();
|
|
29
29
|
}
|
|
30
|
+
public watchResync(callback: () => void): void {
|
|
31
|
+
void this.storage.then(storage => {
|
|
32
|
+
storage.watchResync?.(callback);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
30
35
|
}
|