Rxova
Skip to content

SharedReducer

Type Parameter
S
A
readonly clientId: string;
close(): void;

void


dispatch(action): void;

Apply an action everywhere.

Applied locally first so the UI does not wait for a round trip, then proposed to the leader for ordering. If the committed order turns out to differ from the optimistic one, the local value is rebuilt from the committed state — so a dispatch can be seen out of order for a moment, but never settle out of order.

ParameterType
actionA

void


getSnapshot(): S;

Immutable, replaced whenever the value changes. Safe for useSyncExternalStore.

S


pendingCount(): number;

Number of dispatches from this client that have not yet come back committed. Zero means this client’s view is entirely confirmed.

number


subscribe(fn): () => void;
ParameterType
fn() => void

() => void