Skip to content

js-bao-wss-client


js-bao-wss-client / NetworkModeEvent

Interface: NetworkModeEvent ​

Payload of the networkMode event (client.on("networkMode", ...)).

Fired when the app changes the mode ("auto", or a pinned "online" / "offline") AND when connectivity is lost or restored. A connectivity transition reports the mode unchanged — reachability is not user intent — with isOnline recomputed and reason set to "connectivityLost" or "connectivityRestored". Key offline UI off isOnline, not off mode === "offline".

Properties ​

isOnline ​

isOnline: boolean

The reported online state after this transition.


mode ​

mode: "auto" | "online" | "offline"


reason ​

reason: NetworkTransitionReason

Why the transition happened.

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30