Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClearData does not return a Promise #12

Closed
mikkokam opened this issue Jan 4, 2021 · 1 comment
Closed

ClearData does not return a Promise #12

mikkokam opened this issue Jan 4, 2021 · 1 comment
Assignees
Labels

Comments

@mikkokam
Copy link

mikkokam commented Jan 4, 2021

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)
    })
  }
@dmonad
Copy link
Member

dmonad commented Jan 4, 2021

Right, thanks for opening a ticket!

Fixed in 9.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants