I need to check if some table already exists into IndexedDB just after it was openned. But I don't know how to get DexieDB object inside 'then' statement.
this.db = new Dexie("DBNAME");
if (!this.db.isOpen()) {
this.db.open().then(function () {
//how to get this.db.table(storeName) here?
}).catch(function (error) {
console.log(error)
});
}
So this.db
doesn't exist inside 'then' statement. How to get it?