Rxova
Skip to content

UseLeaderOptions

optional eligible?: boolean;

May this client hold the leadership? Default true.

LeaderOptions.eligible


optional heartbeatMs?: number;

How often the leader re-announces itself, in ms. Default 1000. Heartbeat strategy only.

LeaderOptions.heartbeatMs


optional kind?: PeerKind;

What this client announces itself as. Defaults to ‘worker’ when there is no document, else ‘tab’.

LeaderOptions.kind


optional leaseMs?: number;

How long a follower tolerates silence before calling the seat empty, in ms. Default 3000. Heartbeat strategy only.

LeaderOptions.leaseMs


optional locks?: LockManagerLike;

The Web Locks manager to elect on. Defaults to navigator.locks.

A test seam: @use-everywhere/test-utils passes a FakeLockManager here so several simulated tabs can queue on one seat — and so a crashed tab’s lock is reclaimed — in a plain test process.

LeaderOptions.locks


optional name?: string;

Which bus to elect on. Defaults to the shared default name.


optional strategy?: LeaderStrategy;

How to arbitrate the seat. Default ‘auto’.

LeaderOptions.strategy


optional transport?: (name) => Transport;

Transport factory, mainly for tests. Defaults to defaultTransport.

ParameterType
namestring

Transport

LeaderOptions.transport