Primitives / foldkit-primitives/net

Online

const · packages/primitives/src/net/online.ts:33

Argsnone
Model{ online: boolean }
MessagesChanged { online: boolean }
Its full type
const Online: Bundle.Bundle<
  'Online',
  void,
  { readonly online: boolean },
  { readonly _tag: 'Changed'; readonly online: boolean },
  never,
  never,
  never,
  void,
  {},
  {}
>

Online presence as a bundle: online in the Model, kept current by the window's online/offline events. The browser reports facts; the Model owns the state, so presence replays like any other transition.

In the guides