DEV Community

Discussion on: 🚀 Svelte Quick Tip: Connect a store to local storage

Collapse
 
danawoodman profile image
Dana Woodman

Why would you want to unsubscribe from your store in this context?

Also, as far as I'm aware, onbeforeunload event is fired when a window is being destroyed so there would be no need to unsubscribe since the JS runtime is also destroyed for this page, unless I'm not understanding what you're trying to do?

developer.mozilla.org/en-US/docs/W...