API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classConnectivity
Whether the application should reach the network at all, right now. Two separate questions, deliberately never equated: - state - what the environment appears to provide; - mode - what the application allows. The state is a hint. `navigator.onLine === true` means the host has a network interface, not that a given origin answers; a captive portal, a dead DNS server and a firewalled origin all report as online. Nothing here promises reachability, and code that needs certainty has to try. Connectivity is not cache-specific. It is an ordinary runtime service: UI subscribes to it for an offline banner, and the cache uses it through a CachePolicyResolver rather than reaching into it.
import { Connectivity } from '@codexo/exojs'Whether the application should reach the network at all, right now.
Two separate questions, deliberately never equated:
- state - what the environment appears to provide; - mode - what the application allows.
The state is a hint. `navigator.onLine === true` means the host has a network interface, not that a given origin answers; a captive portal, a dead DNS server and a firewalled origin all report as online. Nothing here promises reachability, and code that needs certainty has to try.
Connectivity is not cache-specific. It is an ordinary runtime service: UI subscribes to it for an offline banner, and the cache uses it through a CachePolicyResolver rather than reaching into it.
destroy(): voidsnapshot(): NetworkSnapshotallowsNetwork: booleanonModeChange: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[NetworkModeWhat the application allows. `'auto'` follows Connectivity.state. `'online'` and `'offline'` are the application's own decision and override it - `'offline'` i…]>onStateChange: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[NetworkHintWhat a host reports about network reachability. `'unknown'` is an answer, not a missing one: a host that cannot say whether a network exists is genuinely not s…]>