<p>&nbsp;</p>
<p align='center'>
  <img src="./website/docs/assets/logo-small.png" width="150" />
</p>
<p align='center'><strong>Vegetarian friendly state for React</strong></p>
<p>&nbsp;</p>

[![npm](https://img.shields.io/npm/v/easy-peasy.svg?style=flat-square)](http://npm.im/easy-peasy)
[![MIT License](https://img.shields.io/npm/l/easy-peasy.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![Codecov](https://img.shields.io/codecov/c/github/ctrlplusb/easy-peasy.svg?style=flat-square)](https://codecov.io/github/ctrlplusb/easy-peasy)

> **v7 Beta** — this release modernises Easy Peasy around React 19's concurrent
> primitives. The public store/model API is unchanged from v6 and the library is
> feature-complete, but the v7 line is still in beta — APIs may shift in
> response to feedback before the stable release. See the
> [v6 → v7 upgrade guide](https://easy-peasy.dev/docs/upgrading-from-v6/) for
> details, or view the [v6 docs](https://easy-peasy-v6.vercel.app/) for the
> current stable release.

<p>Easy Peasy is an abstraction of Redux, providing a reimagined API that focuses on <strong>developer experience</strong>. It allows you to <strong>quickly</strong> and <strong>easily</strong> manage your state, whilst leveraging the strong <strong>architectural guarantees</strong> and extensive <strong>eco-system</strong> that Redux has to offer.</p>

<ul>
  <li>Zero configuration</li>
  <li>No boilerplate</li>
  <li>React hooks based API</li>
  <li>Extensive TypeScript support</li>
  <li>Encapsulate data fetching</li>
  <li>Computed properties</li>
  <li>Reactive actions</li>
  <li>Redux middleware support</li>
  <li>State persistence</li>
  <li>Redux Dev Tools</li>
  <li>Global, context, or local stores</li>
  <li>Built-in testing utils</li>
  <li>React Native supported</li>
  <li>Hot reloading supported</li>
</ul>

<p>&nbsp;</p>

All of this comes via a single dependency install. While v7 is in beta it is
published under the `beta` dist-tag — the `latest` tag will move to v7 once the
stable release ships.

```
npm install easy-peasy@beta
```

<p>&nbsp;</p>

## Fly like an eagle 🦅

**Create your store**

```javascript
const store = createStore({
  todos: ['Create store', 'Wrap application', 'Use store'],

  addTodo: action((state, payload) => {
    state.todos.push(payload);
  }),
});
```

**Wrap your application**

```javascript
function App() {
  return (
    <StoreProvider store={store}>
      <TodoList />
    </StoreProvider>
  );
}
```

**Use the store**

```javascript
function TodoList() {
  const todos = useStoreState((state) => state.todos);
  const addTodo = useStoreActions((actions) => actions.addTodo);
  return (
    <div>
      {todos.map((todo, idx) => (
        <div key={idx}>{todo}</div>
      ))}
      <AddTodo onAdd={addTodo} />
    </div>
  );
}
```

<p>&nbsp;</p>

## Examples 📚

See the [example folder](./examples) for more examples of how to use
`easy-peasy`.

<p>&nbsp;</p>

## Core Team 🛠

<table>
  <tr>
  <td>
    <a href="https://github.com/no-stack-dub-sack">
      <img src="https://avatars.githubusercontent.com/u/18563015?v=4" width="100px;" alt=""/>
      <br />
      <sub><b>Peter Weinberg</b></sub>
    </a>
  </td>
  <td>
    <a href="https://github.com/jmyrland">
      <img src="https://avatars.githubusercontent.com/u/837651?v=5" width="100px;" alt=""/>
      <br />
      <sub><b>Jørn A. Myrland</b></sub>
    </a>
  </td>
  <td>
    <a href="https://github.com/ctrlplusb">
      <img src="https://avatars.githubusercontent.com/u/12164768?v=4" width="100px;" alt=""/>
      <br />
      <sub><b>Sean Matheson</b></sub>
    </a>
  </td>
  </tr>
</table>

<p>&nbsp;</p>

## Our Sponsors ❤️

We have only but great appreciation to those who support this project. If you
have the ability to help contribute towards the continued maintenance and
evolution of this library then please consider
[[becoming a sponsor](https://opencollective.com/easy-peasy#backer)].

<a href="https://opencollective.com/easy-peasy#backers">
    <img src="https://opencollective.com/easy-peasy/backers.svg?width=950" />
</a>

<p>&nbsp;</p>

## Documentation

See the [official website](https://easy-peasy.dev) for tutorials, docs, recipes,
and more.
