Brings the server's live updates into the app. It holds the one WebSocket to /ws and turns its messages into the state of WSContext, WSChatContext, WSPresenceContext and AvatarOverrideContext, and into the events of WSEventsContext. App mounts it around every page. The protocol is shared/ws.ts, and the server's side is api/routes/ws.ts.

Functions

f
WSProvider(unnamed 0: WSProviderProps): React.JSX.Element

Provides WSContext, WSChatContext, WSPresenceContext, AvatarOverrideContext and WSEventsContext. It connects with the session's token, or anonymously, and reconnects with a backoff doubling up to 30 s. A new token (sign-in, sign-out, another account) clears the live state and reconnects. A new notification or chat message chimes, and the unread counts go in the tab title.

Interfaces