Skip to content

@statesync/persistence


@statesync/persistence / CrossTabSyncOptions

Interface: CrossTabSyncOptions ​

Defined in: persistence/src/types.ts:726

Options for cross-tab state synchronization via the BroadcastChannel API.

Controls the channel name and whether this tab sends and/or receives updates.

Extended by ​

Properties ​

broadcastSaves? ​

ts
optional broadcastSaves: boolean;

Defined in: persistence/src/types.ts:747

Whether this tab should broadcast its saves to other tabs.

Default Value ​

true


channelName ​

ts
channelName: string;

Defined in: persistence/src/types.ts:733

The name of the BroadcastChannel used for inter-tab communication.

All tabs that should synchronize state must use the same channel name. Convention: 'state-sync:<topic>'.


receiveUpdates? ​

ts
optional receiveUpdates: boolean;

Defined in: persistence/src/types.ts:740

Whether this tab should apply snapshots received from other tabs.

Default Value ​

true

Released under the MIT License.