Skip to content

@laboverwire/stitch

Reactive state synchronization for React and Vue. A thin, framework-agnostic binding layer over @laboverwire/stitch-wasm — a Rust/WASM package that owns the in-memory store, IndexedDB persistence, and MQTT-based remote sync. This package wraps that WASM Store in a small adapter and ships React and Vue 3 bindings on top; all store, sync, persistence, and offline-queue logic lives inside the WASM.

npm install @laboverwire/stitch
import { createStore } from '@laboverwire/stitch';

const store = createStore<Schema>(config, {
  persistence: { dbName: 'my-app' },
  remote: { url: 'wss://mqtt.example.com', ticket: await fetchAuthTicket() },
});

await store.initialize();
await store.replaceScope('project-abc');

const tasks = store.getSnapshot('task', 'project-abc');

remote.url is a ws:///wss:// MQTT endpoint. Pass ticket (a JWT) for MQTT v5 enhanced auth, or username/password for classic password auth. A persistence.passphrase enables AES-GCM encryption of the IndexedDB store.

Documentation

examples/ contains runnable vanilla-TS, React, and Vue apps that double as reference implementations.

License

Apache-2.0 — see LICENSE.

About

Reactive state synchronization library bridging an in-memory store, IndexedDB persistence, and MQTT-based remote sync.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages