sliftutils 0.79.0 → 0.80.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliftutils",
3
- "version": "0.79.0",
3
+ "version": "0.80.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -12,12 +12,13 @@ export class StorageSync<T> implements IStorageSync<T> {
12
12
  }, undefined, { deep: false });
13
13
 
14
14
  constructor(public storage: IStorage<T>) {
15
- storage.watchResync?.(() => {
16
- this.cached.clear();
17
- this.infoCached.clear();
18
- this.keys.clear();
15
+ storage.watchResync?.(async () => {
16
+ // NOTE: If there's multiple tabs open, this'll trigger a lot, so we can't just clear all the values, as that'll cause a render where nothing's loaded.
19
17
  this.loadedKeys = false;
20
- this.synced.keySeqNum++;
18
+ let keys = await this.getKeysPromise();
19
+ for (let key of keys) {
20
+ this.get(key);
21
+ }
21
22
  });
22
23
  }
23
24