MCPcopy Index your code
hub / github.com/bholmesdev/simplestack-store

github.com/bholmesdev/simplestack-store @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
79 symbols 210 edges 19 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Simple Store

<a href='https://github.com/bholmesdev/simplestack-store' rel='nofollow'>
    <img alt='stars' src='https://img.shields.io/github/stars/bholmesdev/simplestack-store?color=blue'>
</a>
<a href='https://www.npmjs.com/package/@simplestack/store' rel='nofollow'>
    <img alt='npm' src='https://img.shields.io/npm/v/@simplestack/store?color=blue'>
</a>

I fixed Zustand's BIGGEST problem

A simple, select-xcellent state management library for React.

The goal: make a storage solution as powerful as Zustand or Redux, without complicated functions to set and select state.

Here's an overview of how stores are created, and how you can operate on parts of a store using .select():

import { store } from "@simplestack/store";
import { useStoreValue } from "@simplestack/store/react";

// Define your store with an initial state
const documentStore = store({
  title: "Untitled",
  authors: ["Ada", "Ben"],
  meta: {
    pages: 3,
    tags: ["draft", "internal"],
  },
});

function Document() {
  // Update your UI with the store's current state
  const {
    title,
    meta: { tags },
  } = useStoreValue(documentStore);
  return (



      {title} {tags.join(", ")}



  );
}

// Or, select parts of a store to listen to individually
const titleStore = documentStore.select("title");
const tagsStore = documentStore.select("meta", "tags");

function Title() {
  // And scope updates with selected stores for fine-grained control
  const title = useStoreValue(titleStore);
  return (
    <input value={title} onChange={(e) => titleStore.set(e.target.value)} />
  );
}

📚 For a complete usage guide and API reference, visit our documentation.

Contributing

We are open to contributions! Before submitting your feature request, please read the CONTRIBUTING.md for our issue and PR process.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Core symbols most depended-on inside this repo

store
called by 157
src/index.ts
useStoreValue
called by 63
src/react.ts
shallow
called by 38
src/shallow.ts
nextTick
called by 15
src/test-utils.ts
isStatePrimitive
called by 4
src/index.ts
useShallow
called by 4
src/react.ts
get
called by 3
src/index.ts
warnDiscardedSet
called by 3
src/index.ts

Shape

Function 79

Languages

TypeScript100%

Modules by API surface

src/integration.test.tsx19 symbols
src/index.ts17 symbols
src/react.test.tsx14 symbols
src/middleware.test.ts7 symbols
src/ssr.test.tsx5 symbols
src/shallow.ts5 symbols
src/react.ts4 symbols
src/index.test.ts2 symbols
examples/vite-react/src/main.tsx2 symbols
examples/nextjs/app/page.tsx2 symbols
src/test-utils.ts1 symbols
examples/nextjs/app/layout.tsx1 symbols

For agents

$ claude mcp add simplestack-store \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact