Primitives / Network

foldkit-primitives/net

What the network reported last: whether the browser is online, the state of a socket or an event stream, a post from another tab. Connection state lives in the Model; a payload only notifies, and the parent keeps what it wants of it. (source)

NameFormModelMessagesArgs
Onlinebundle{ online }Changed { online }none
websocket({ name, createSocket? })bundle factory{ url, status, lastError, opened }Connecting, Opened, Received { data }, Sent { data }, SendFailed, Closed, Failed, TimedOut{ url, connectTimeoutMs? }
sse({ name, createSource? })bundle factory{ url, status, lastError }Connecting, Opened, Received { data }, Closed, Failed{ url }
broadcastMessages(name)entryReceived { data }
postBroadcast(name, data)CommandPosted, BroadcastFailed
SharedHost.define({ name, opening })plain functions