I was purging an ever-growing IndexedDB database occasionally - trying to use await indexeddbProvider.clearData(); as the documentation says provider.clearData(): Promise.
Typescript rightfully reports:
'await' has no effect on the type of this expression.ts(80007)
/**
* Destroys this instance and removes all data from indexeddb.
*/
clearData () {
this.destroy().then(() => {
idb.deleteDB(this.name)
})
}
Maybe this would fix it:
/**
* Destroys this instance and removes all data from indexeddb.
*/
clearData () {
return this.destroy().then(() => {
idb.deleteDB(this.name)
})
}
I was purging an ever-growing IndexedDB database occasionally - trying to use
await indexeddbProvider.clearData();
as the documentation saysprovider.clearData(): Promise
.Typescript rightfully reports:
Maybe this would fix it: