makeSingleTabAdapter
makeSingleTabAdapter(
options):Adapter
Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:145
Creates a single-tab web adapter with OPFS persistence.
This adapter is a fallback for browsers without SharedWorker support (notably Android Chrome).
It provides the same persistence capabilities as makePersistedAdapter, but without multi-tab
synchronization. Each browser tab runs its own independent leader worker.
In most cases, you should use makePersistedAdapter instead, which automatically falls back
to this adapter when SharedWorker is unavailable.
Limitations:
- No multi-tab synchronization (each tab operates independently)
- No devtools support (requires SharedWorker)
- Opening multiple tabs with the same storeId may cause data conflicts
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Adapter
- https://github.com/livestorejs/livestore/issues/321 - LiveStore tracking issue
- https://issues.chromium.org/issues/40290702 - Chromium SharedWorker bug
Example
Section titled “Example”import { makeSingleTabAdapter } from '@livestore/adapter-web'import LiveStoreWorker from './livestore.worker.ts?worker'
// Only use this directly if you specifically need single-tab mode.// Prefer makePersistedAdapter which auto-detects SharedWorker support.const adapter = makeSingleTabAdapter({ worker: LiveStoreWorker, storage: { type: 'opfs' },})