AKASHAorg / secure-webstore

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

How to test for existing store before creating new one #32

Open MG1376 opened 2 months ago

MG1376 commented 2 months ago

I have this js method that I call from blazor's OnAfterRender to setup a new store or (TODO: to use existing store):

setUpSecureStore: function (passPhrase) {
    const Store = window.SecureStore.Store;

    const store = new Store('my-store', passPhrase);

    store.init().then(() => {
        // store is ready
        window.Store = store;
    });
},

how to check for existing store so that to set a variable of it in window.Store?