Subscribe to online/offline changes in your apps.
elm-online
wraps "online" and "offline" events from the browser (see mdn/Online_and_offline_events).
Run the example in elm-reactor like this:
$ cd examples
$ elm-reactor
import Online
type Msg = ChangeOnline Bool | ...
subscriptions _ = Online.changes ChangeOnline
This is based on elm-lang/geolocation original license is included in this repo.