MCPcopy Index your code
hub / github.com/Omnistac/zedux

github.com/Omnistac/zedux @v1.3.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.5 ↗ · + Follow
678 symbols 2,309 edges 243 files 67 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Zedux

Build Status codecov.io npm license

A Molecular State Engine for React.

Zedux is a multi-paradigm state management tool that features a powerful composable store model wrapped in a DI-driven atomic architecture.

Installation

npm install @zedux/react # npm
yarn add @zedux/react # yarn
pnpm add @zedux/react # pnpm

The React package (@zedux/react) contains everything you need to use Zedux in a React app - the core store model, the core atomic model, and the React-specific APIs.

@zedux/react has a peer dependency on React. It supports React version 18 and up.

Intro

We borrowed ideas from dozens of state management tools over the past 5 years, invented a few ourselves, and put it all together in one powerhouse of a state management library.

Most notably, Zedux borrows ideas from Redux, Recoil, and React Query. Zedux takes the unique approach of separating the state layer (stores) from the architecture layer (atoms). This allows for a powerful Dependency Injection model, conceptually similar to Angular's but simpler and more dynamic.

Sound complex? Zedux is actually very beginner-friendly. In fact, here's all you need to begin:

import { atom, useAtomState } from '@zedux/react'

const greetingAtom = atom('greeting', 'Hello, World!')

function Greeting() {
  const [greeting, setGreeting] = useAtomState(greetingAtom)

  return (
    <input
      onChange={event => setGreeting(event.target.value)}
      value={greeting}
    />
  )
}

We'll break down this example and so much more in the docs.

Learn Zedux

To embark on the journey of mastering Zedux, jump into the quick start.

If you prefer something more high-level, the introduction's a decent place to start. Or if you want to learn Everything Everywhere All at Once, the API docs or repo source code and tests are real page-turners.

Happy coding!

Contributing

Contributions an any level are absolutely welcome! Have a look at the contribution guidelines.

Bugs can be reported here.

Questions, feature requests, ideas, and links to cool projects or examples are always welcome in the discussions page.

License

The MIT License.

Extension points exported contracts — how you extend this code

AtomGettersBase (Interface)
(no doc) [2 implementers]
packages/atoms/src/types/index.ts
Observable (Interface)
(no doc) [1 implementers]
packages/core/src/types.ts
Computed (Interface)
(no doc) [1 implementers]
bench/src/util/reactiveFramework.ts
ViteBaseConfigOptions (Interface)
(no doc)
packages/vite-base-config.ts
ZeduxHookConfig (Interface)
(no doc)
packages/react/src/types.ts
MachineState (Interface)
(no doc)
packages/machines/src/injectMachineStore.ts
Edge (Interface)
(no doc)
docs/src/components/GraphAnimation.tsx
AtomConfig (Interface)
(no doc)
packages/atoms/src/types/index.ts

Core symbols most depended-on inside this repo

atom
called by 210
packages/atoms/src/factories/atom.ts
getState
called by 182
packages/core/src/api/createStore.ts
getInstance
called by 164
packages/atoms/src/types/index.ts
createStore
called by 144
packages/core/src/api/createStore.ts
setState
called by 129
packages/atoms/src/classes/instances/AtomInstance.ts
read
called by 94
bench/src/util/reactiveFramework.ts
useAtomValue
called by 67
packages/react/src/hooks/useAtomValue.ts
use
called by 67
packages/core/src/api/createStore.ts

Shape

Function 400
Method 167
Interface 60
Class 50
Enum 1

Languages

TypeScript100%

Modules by API surface

packages/atoms/src/classes/Ecosystem.ts30 symbols
bench/src/sBench.ts27 symbols
docs/src/ssc/index.tsx23 symbols
packages/core/src/api/createStore.ts22 symbols
packages/atoms/src/classes/Selectors.ts22 symbols
scripts/release.js21 symbols
packages/atoms/src/classes/instances/AtomInstance.ts19 symbols
packages/atoms/src/types/index.ts18 symbols
docs/src/theme/CodeBlock/Sandbox.tsx18 symbols
packages/atoms/src/classes/Graph.ts17 symbols
packages/core/src/types.ts15 symbols
packages/atoms/src/classes/Scheduler.ts12 symbols

For agents

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

⬇ download graph artifact

Ask about this repo answers extend the page