dmonad / lib0

Monorepo of isomorphic utility functions
MIT License
368 stars 65 forks source link

Discouraged `unload` event used in indexeddb #78

Closed westonruter closed 1 year ago

westonruter commented 1 year ago

There is currently a use of the unload event in indexeddb:

https://github.com/dmonad/lib0/blob/262570288c55ee613c7883d34891b5f9584410af/indexeddb.js#L52

This event handler is being deprecated by Chrome. Its use is also warned against on MDN as it is unreliable and it disables bfcache.

See Chrome's suggested alternatives, including the pagehide event.

dmonad commented 1 year ago

There is probably a reason why I added the unload event. But that was 4 years ago. So let's try without ..