add async methods.

This commit is contained in:
Rintim 2023-09-19 23:09:37 +08:00
parent bdd031223f
commit e449eabab2
1 changed files with 6 additions and 2 deletions

View File

@ -24749,8 +24749,12 @@
return this.hasStorage(name)?this.getStorage(name):this.setStorage(name,value);
},
updateStorage:function(name,operation){
this.setStorage(name,operation(this.getStorage(name)));
return this.getStorage(name);
return this.setStorage(name,operation(this.getStorage(name)));
},
updateStorageAsync:function(name,operation){
return Promise.resolve(this.getStorage(name))
.then(value=>operation(value))
.then(value=>this.setStorage(name,value))
},
markSkill:function(name,info,card){
if(info===true){