The type of values stored in channels.
Values should include a timestamp field for ordering;
if omitted, the current time is used automatically.
The type of values stored in channels.
Values should include a timestamp field for ordering;
if omitted, the current time is used automatically.
The connected StatementStoreClient to use.
Optionaloptions: { topic2?: string }Optional secondary topic for scoping channels.
Destroy the channel store and clean up subscriptions.
Does not destroy the underlying client.
Subscribe to channel value changes.
The callback is invoked whenever a channel value is updated (either from the network or from a local write).
A handle to unsubscribe.
Read the latest value for a channel by its human-readable name.
Looks up the channel hash from the name, then retrieves the value. Also checks the hash directly for values received from the network before any local write established the name mapping.
The channel name (e.g., "presence/peer-abc").
The latest value, or undefined if no value has been received.
Write a value to a named channel.
If the value doesn't include a timestamp, one is added automatically
using Date.now(). The value is published to the statement store
with the channel name as the statement channel.
The channel name (e.g., "presence/peer-abc").
The value to write.
true if the statement was accepted by the network.
Higher-level abstraction providing last-write-wins channel semantics over the statement store.
Each channel name maps to a single value. When a new value is written to a channel, it replaces the previous one if its timestamp is newer. This is ideal for presence announcements, signaling, and ephemeral state.
Example