Documentation / @zerotal/flow / index / SharedStore
Interface: SharedStore
Defined in: flow/src/shared.ts:39
Pluggable backing store for @shared room state — the canonical, per-channel
value that all subscribers converge on.
Remarks
Keys are of the form channel::prop. Stored values are already deep-cloned by
the caller, so the store may hold references without aliasing component state.
The default is an in-process MemorySharedStore; swap a distributed
implementation (e.g. Redis-backed) via setSharedStore to converge
across processes. Implement all three methods synchronously.
Methods
get()
get(
key):unknown
Defined in: flow/src/shared.ts:41
Read the current value for a channel::prop key, or undefined if unset.
Parameters
key
string
Returns
unknown
set()
set(
key,value):void
Defined in: flow/src/shared.ts:43
Write the canonical value for a channel::prop key.
Parameters
key
string
value
unknown
Returns
void
has()
has(
key):boolean
Defined in: flow/src/shared.ts:45
Whether a value has been stored for a channel::prop key.
Parameters
key
string
Returns
boolean