SingleTabAdapterOptions
SingleTabAdapterOptions =
object
Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:61
Options for the single-tab adapter.
This adapter is designed for browsers without SharedWorker support (e.g. Android Chrome). It provides OPFS persistence but without multi-tab synchronization.
Properties
Section titled “Properties”clientId?
Section titled “clientId?”
optionalclientId:string
Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:94
By default the adapter will initially generate a random clientId (via nanoid(5)),
store it in localStorage and restore it for subsequent client sessions.
experimental?
Section titled “experimental?”
optionalexperimental:object
Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:102
disableFastPath?
Section titled “disableFastPath?”
optionaldisableFastPath:boolean
When set to true, the adapter will always start with a snapshot from the leader
instead of trying to load a snapshot from storage.
Default
Section titled “Default”falseresetPersistence?
Section titled “resetPersistence?”
optionalresetPersistence:boolean
Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:88
Warning: This will reset both the app and eventlog database. This should only be used during development.
Default
Section titled “Default”falsesessionId?
Section titled “sessionId?”
optionalsessionId:string
Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:100
By default the adapter will initially generate a random sessionId (via nanoid(5)),
store it in sessionStorage and restore it for subsequent client sessions in the same tab.
storage
Section titled “storage”storage:
StorageTypeEncoded
Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:80
Storage configuration. Currently only OPFS is supported.
worker
Section titled “worker”worker: (
options) =>globalThis.Worker| (options) =>globalThis.Worker
Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:75
The dedicated web worker that runs the LiveStore leader thread.
Example
Section titled “Example”import LiveStoreWorker from './livestore.worker.ts?worker'
const adapter = makeSingleTabAdapter({ worker: LiveStoreWorker, storage: { type: 'opfs' },})