easy-peasy

Vegetarian friendly state for React

README

 

Vegetarian friendly state for React

 

npm MIT License Travis Codecov

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

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

 


All of this comes via a single dependency install.

  1. ```
  2. npm install easy-peasy
  3. ```

 


Fly like an eagle 🦅


Create your store

  1. ``` js
  2. const store = createStore({
  3.   todos: ['Create store', 'Wrap application', 'Use store'],

  4.   addTodo: action((state, payload) => {
  5.     state.todos.push(payload);
  6.   }),
  7. });
  8. ```

Wrap your application

  1. ``` js
  2. function App() {
  3.   return (
  4.     <StoreProvider store={store}>
  5.       <TodoList />
  6.     </StoreProvider>
  7.   );
  8. }
  9. ```

Use the store

  1. ``` js
  2. function TodoList() {
  3.   const todos = useStoreState((state) => state.todos);
  4.   const addTodo = useStoreActions((actions) => actions.addTodo);
  5.   return (
  6.     <div>
  7.       {todos.map((todo, idx) => (
  8.         <div key={idx}>{todo}</div>
  9.       ))}
  10.       <AddTodo onAdd={addTodo} />
  11.     </div>
  12.   );
  13. }
  14. ```

 


Examples 📚


See the example folder for more examples of how to use
easy-peasy.

 


Core Team 🛠



Peter Weinberg

Jørn A. Myrland

Sean Matheson

 


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

 


Documentation


See the official website for tutorials, docs, recipes,
and more.

 


OS Awards Nominee


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