Skip to content

super-storeA reactive store, quietly backed by a CRDT

Write it like in-memory state. Get real-time collaboration, offline persistence, and undo/redo — opt-in, behind the same API.

counter.ts
import { StoreValue } from "@super-store/store"

// Local — identical to an in-memory store:
const counter = new StoreValue(0)
counter.subscribe(() => render(counter.getSnapshot()))
counter.set(1)  // renders 1

// Collaborative — same handle, opt-in:
counter.onUpdate((u, { local }) => local && bus.send(u))
bus.on("message", (u) => counter.applyUpdate(u))
localcollaborativeno yjs import

Two stores, kept in sync

Each grid below is its own StoreValue, backed by its own document — not shared state. Toggle a cell: your edit travels as CRDT bytes and merges into the other. Edit both at once; concurrent changes to different cells each win.

peer a
peer b
live0 updates relayed·0 bytes

Released under the MIT License.