I am saving data from the user in an indexeddb. When the user closes my app (i.e. the browser), I want to delete this storage. However, since IndexedDB requests are asynchronous, they won't be executed on beforeunload
. This is why I am curious to see, how other people solved this issue? Is there any way at all?
Merry Christmas!
An answer that taken from MDN:
The synchronous API being intended for use only with Web Workers. The synchronous version was removed from the spec because its need was questionable, however it may be reintroduced in the future if there is enough demand from web developers.