@ -41,7 +41,8 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@@ -41,7 +41,8 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@ -59,8 +60,12 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@@ -59,8 +60,12 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@ -140,6 +145,7 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@@ -140,6 +145,7 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
this.getThrottled=throttle(async()=>{
constkeys=Array.from(this.getPromises.keys());
// const perf = performance.now();
this.storage.get(keysasstring[]).then(values=>{
for(leti=0,length=keys.length;i<length;++i){
constkey=keys[i];
@ -150,6 +156,8 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@@ -150,6 +156,8 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
this.getPromises.delete(key);
}
}
// console.log('[AS]: get time', keys, performance.now() - perf);
@ -214,6 +222,7 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@@ -214,6 +222,7 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@ -233,7 +242,7 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@@ -233,7 +242,7 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
value=stringify(value);
console.log('LocalStorage set: stringify time by own stringify:',performance.now()-perf);*/
if(this.useStorage&&!onlyLocal){
if(canUseStorage){
this.keysToSet.add(key);
this.keysToDelete.delete(key);
this.saveThrottled();
@ -241,7 +250,7 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@@ -241,7 +250,7 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@ -291,6 +300,14 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D
@@ -291,6 +300,14 @@ export default class AppStorage<Storage extends Record<string, any>, T extends D