misostore-core
v0.2.4
Published
MisoStore framework-agnostic core
Maintainers
Readme
misostore-core
Framework-agnostic core primitives for MisoStore.
- Source: https://github.com/pratul03/storekit/tree/main/library/packages/core
- Issues: https://github.com/pratul03/storekit/issues
- Security: https://github.com/pratul03/storekit/security/advisories
Installation
pnpm add misostore-coreQuick start
import { createStore } from "misostore-core";
type CounterState = { count: number };
type CounterAction = { type: "inc" } | { type: "dec" };
const counter = createStore<CounterState, CounterAction>(
{ count: 0 },
(state, action) => {
if (action.type === "inc") return { ...state, count: state.count + 1 };
if (action.type === "dec") return { ...state, count: state.count - 1 };
return state;
},
);
counter.dispatch({ type: "inc" });
console.log(counter.getState().count);What this package provides
createStorefor creating deterministic state containers- Typed state and action flows for TypeScript-first projects
- Framework-agnostic runtime primitives used by adapter packages
Compatibility
- Node.js:
>=18 - Runtime module format: ESM
- Type definitions: bundled (
dist/index.d.ts)
Links
- Changelog: ./CHANGELOG.md
- Security policy: ./SECURITY.md
License
MIT
