Skip to content

Standard Store

Like Standard Schema, but for state management.

Standard Store is a lightweight, type-safe state management library for JavaScript and TypeScript. It provides a simple API for creating stores, managing state, and persisting data with flexible storage adapters.

Inspired by Standard Schema, it brings the same philosophy of typed, interoperable interfaces to state management.

import { createStore } from "@standard-store/store";
// Create a store with initial state
const store = createStore({
count: 0,
name: "Standard Store",
});
// Get state
store.getState(); // { count: 0, name: 'Standard Store' }
// Update state (partial merge)
store.setState({ count: 1 });
// Subscribe to changes
const unsubscribe = store.subscribe((state) => {
console.log("State updated:", state);
});
  • Type-safe — Full TypeScript support with typed stores and validation
  • Lightweight — Minimal core with zero runtime dependencies
  • Flexible adapters — Persist state to localStorage, sessionStorage, cookies, memory, and more
  • Middleware — Intercept and extend state operations with logging, validation, and side effects
  • Framework agnostic — Works with React or any JavaScript framework
  • Partial updates — setState merges with existing state for granular updates

Check out more of my work - Mamello Seboholi.