Introduction
These are the v1 docs. They are not maintained.
This page is a verbatim snapshot of the commiq 1.x documentation, kept for people still running 1.x. It is not corrected and not tested against any release. Several pages contain claims that were wrong when written: examples that do not run as printed, sealStore described as read-only when it was not, handledEvent presented as a working subscription pattern when it never matched, and effects described as swallowing only AbortError when they swallowed everything.
Do not treat anything here as a statement about how commiq 2.x behaves.
What changed in 2.0 and how to upgrade · Current documentation
Site search only indexes the current docs. Use the sidebar to browse these pages.
Introduction
Commiq is a lightweight, command & event driven state management library for TypeScript. The core library has no framework dependencies — React bindings are available separately via @naikidev/commiq-react.
Instead of directly mutating state, you describe what should happen via commands, and the store's handlers decide how the state changes. Handlers can emit events to notify other parts of your application — enabling clean, decoupled architectures.
Key Concepts
| Concept | Description |
|---|---|
| Command | A request to do something — dispatched via queue() |
| Handler | A function that processes a command and updates state |
| Event | A notification that something happened — emitted by handlers |
| Store | Holds state, routes commands to handlers, broadcasts events |
| Sealed Store | A read-only proxy exposing only state, queue, and streams |
| Event Bus | Routes events between multiple stores |
Packages
@naikidev/commiq— Core library (framework-agnostic)@naikidev/commiq-react— React bindings (useSelector,useQueue,useEvent,CommiqProvider)@naikidev/commiq-devtools-core— Instrumentation, event timeline, and causality tracking@naikidev/commiq-devtools— Embedded devtools panel for React applications@naikidev/commiq-otel— OpenTelemetry tracing integration
Quick Example
import { createStore, createCommand, sealStore } from "@naikidev/commiq";
const store = createStore({ count: 0 });
store.addCommandHandler("increment", (ctx) => {
ctx.setState({ count: ctx.state.count + 1 });
});
const sealed = sealStore(store);
sealed.queue(createCommand("increment", undefined));