mibrito707 / cordova-plugin-secure-storage-echo

Secure storage plugin for Apache Cordova
MIT License
73 stars 73 forks source link

Secure storage is asynchronous #72

Open InesBorgesCore opened 3 years ago

InesBorgesCore commented 3 years ago

I just realized that secure storage is asynchronous because my last declared function runs first. How can I make it synchronous?

Like this?:

async function setConfig(){
      await ss.set(
        function(key) {
          console.log("Set " + key);
        },
        function(error) {
          console.log("Error " + error);
        },
        "config",
        JSON.stringify(config)
      );
    }