interface ViewClient<TState = unknown> The framework-neutral surface every generated client shares.
Properties
snapshot
readonly snapshot: TState; The latest state, with the value of each setter call that is still on its way (specs/application, "Client overlay"): a member shows the latest value the page set until the producer's state includes that edit, or the edit failed. After dispose() or a Bridge session change it stays the last state the client exposed. It is the state subscribers last received. The client applies each frame when it arrives and delivers the resulting state once per animation frame (a timer while the page is hidden). A setter call shows its value at once, and a call resolves only after the state it waited for was delivered.
Methods
subscribe
subscribe(listener: (state: TState) => void): () => void; Delivers the current state, then each change of snapshot, until the returned function is called: at most once per animation frame for the producer's frames, and at once for a setter call or before a call resolves. After dispose() it delivers the last state once and returns a no-op.
dispose
dispose(): void; Releases this connection. Further calls reject with a released BridgeError, or disconnected while the Bridge is disconnected.