Home

Awesome

<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 MIT License Codecov

<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.

npm install easy-peasy
<p>&nbsp;</p>

Fly like an eagle 🦅

Create your store

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

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

Wrap your application

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

Use the store

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 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].

<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 for tutorials, docs, recipes, and more.

<p>&nbsp;</p>

OS Awards Nominee

Easy Peasy was nominated under the "Productivity Booster" category.