Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

sveltekit saving offline/online status for the entire app

$
0
0

What is the best approach to save and use online/offline status all over a client side only app created with sveltekit?

Session/Cookies?The app deployed as static using addapter_static, as PWA with offline support

In order to avoid writing the following code on every page.

// addEventListener versionwindow.addEventListener("offline", (event) => {  console.log("The network connection has been lost.");});// onoffline versionwindow.onoffline = (event) => {  console.log("The network connection has been lost.");};

According to the changes status I want to change the top menu background color, show background image on every page and in some cases disable buttons


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>