Today I Learned: Checking for PWA network connectivity via Svelte stores

You can check if your PWA has network connectivity in a one line Svelte store using navigator.online (if there isn't a browser you must be online because the site is being streamed from the server)

Special thanks to Adarsh for helping me figure this out! :)

export let isOnline = readable(browser ? navigator.onLine : true)

This store will help you disable external API calls which can cause trouble when you're offline, so instantiate it once and call it anywhere you would like!

That's all for now, here's a link back to /articles.