Skip to content

makeInMemoryAdapter

makeInMemoryAdapter(options): Adapter

Defined in: packages/@livestore/adapter-web/src/in-memory/in-memory-adapter.ts:75

Create a web-only in-memory LiveStore adapter.

  • Runs entirely in memory: fast, zero I/O, great for tests, sandboxes, or ephemeral sessions.
  • Works across browser execution contexts: Window, WebWorker, SharedWorker, and ServiceWorker.
  • DevTools: to inspect this adapter from the browser DevTools, provide a sharedWorker in options.devtools. (The shared worker is used to bridge the DevTools UI to the running session.)
  • No persistence support: nothing is written to OPFS/IndexedDB/localStorage. importSnapshot can bootstrap initial state only; subsequent changes are not persisted anywhere.

InMemoryAdapterOptions = {}

Adapter