~toastal/purescript-emitters-connectivity

Subscribable emitter for browser connectivity (are we online or offline?)
Case clearly + wet isn’t a clear enough name
Lint check + Nix Flake update
Upgrade PureScript packages + format

clone

read-only
https://git.sr.ht/~toastal/purescript-emitters-connectivity
read/write
git@git.sr.ht:~toastal/purescript-emitters-connectivity

You can also use your local clone with git send-email.

purescript-emitters-connectivity

A module to ascertain the browser’s connectivity states (e.g. are we online?). Navigator.onLine and online and offline events have some problems. A common solution is to test if the favicon.ico returns a successful response, which is the default behavior, but it can be disabled or a different request can be pinged.

This module uses Halogen Subscriptions, and as their docs state does not depend on Halogen (though it’s certainly a recommendable front-end framework) which means this can be consumed in any situation.

Installation

If/when upstreamed to package-sets, but if not manually add to {spago,packages}.dhall

Via spago
$ spago install emitters-connectivity

License

This project is licensed under Mozilla Public License Version 2.0 (MPL-2.0) — see the LICENSE file in this project for details.

Setup

Git

Hooks and config
$ git config --local include.path ../.gitconfig
$ git config --local core.hooksPath .githooks

Nix + Flakes

For dev shell
$ nix develop
For automatic shell via direnv
$ direnv allow
Caching via Cachix
$ cachix use purescript-emitters

Not Nix

Requirements
package version
purs ~0.15.0
spago ^0.20.8
purs-tidy latest

Although assume the flake.{nix,lock} as the source of truth.

Funding

If you want to make a small contribution to the maintanence of this & other projects

Do not follow this link