@naikidev/commiq
v1.1.0
Published
Command and event driven state management for JavaScript and TypeScript.
Readme
@naikidev/commiq
Command and event driven state management for JavaScript and TypeScript.
Install
pnpm add @naikidev/commiqUsage
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));Documentation
Full docs at naikidev.github.io/commiq.
License
MIT
