javascript - How can I wait until an IndexedDB instance is closed? -
the indexeddb method close is asynchronous, how can wait until close has finished? usecase close indexeddb after automated tests , before next test, delete database , re-open it.
the problem i'm seeing indexeddb.deletedatabase fires blocked event because database hasn't yet been closed asynchronously (as can see deletedatabase's documentation linked to). i'm not entirely sure if database still deleted in case, despite blocked event being fired.
you don't need wait close completed events, close, delete database , re-open it.
as can see in indexeddb api doc, close method not dispatch completed event, database delete method does. anyways don't need listen these events.
Comments
Post a Comment