onlineStore

A readable boolean store to easily access the current state of the network, whether it is online or offline. Uses networkStore internally.

Demo

Try switching to offline using Network tab in Devtools or turning off your Wifi.

Is Online: true

Usage

<script lang="ts">
import { onlineStore } from 'svelte-legos';

const isOnline = onlineStore();

// use $isOnline as a boolean state
</script>