Function: createSharedStore()
function createSharedStore<S>(
name,
initial,
options?): SharedStore<S>;
State synced across every same-origin tab/window/worker: per-key last-writer-wins version clocks and a hello/snapshot late-joiner handshake. Create at most one store per name per tab (the React package memoizes).
Type Parameters
| Type Parameter |
|---|
S extends Record<string, unknown> |
Parameters
| Parameter | Type |
|---|---|
name | string |
initial | S |
options? | SharedStoreOptions |
Returns
SharedStore<S>