AKASHAorg / secure-webstore

A secure IndexedDB store with built-in encryption
MIT License
44 stars 6 forks source link

"Promise { <state>: "pending" }" after try to get data #15

Closed Master-Y0da closed 3 years ago

Master-Y0da commented 3 years ago

I finally could create a DB and it's working fine: caption . But there is a problem when I try to get data in vue 2 project.

First when I try: await store.get('info') . I get error "can not use await outside async function". So I try this:

    let data = (async () => { await self.$store.get('info') })();
    console.log(data)`

And it seems to pass, except by the console that prints this: `Promise { "pending" } ​

: "fulfilled" ​ : undefined` So I can't get the data from my DB, I hope you can help me, thanks!!
deiu commented 3 years ago

I'm glad to hear you got it working!

On the other hand, the problem you have described above is not related to this library. I think you should look into how to properly use await/async in Javascript. Alternatively you can also handle the promises in a classic way (using then(), etc.).

I am closing this issue as it is not related to the library.