ep

easy-peasy

Vegetarian friendly state for React

Showing:

Popularity

Downloads/wk

28.9K

GitHub Stars

4.5K

Maintenance

Last Commit

3d ago

Contributors

55

Package

Dependencies

5

Size (min+gzip)

10.5KB

License

MIT

Type Definitions

Built-In

Tree-Shakeable

Yes?

Categories

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.

npm install easy-peasy

 

Fly like an eagle

Create your store

const store = createStore({
  todos: {
    items: ['Create store', 'Wrap application', 'Use store'],
    add: action((state, payload) => {
      state.items.push(payload);
    }),
  },
});

Wrap your application

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

Use the store

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

 

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

 

Documentation

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

 

OS Awards Nominee

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
Saša PulHelsinki, Finland17 Ratings21 Reviews
6 months ago

Used it in my workplace, as a replacement for redux. It was really refreshing to use, less boilerplate, full support for hooks, and easy API. That being said, it doesn't scale well. When project grows beyond a certain point, it becomes cumbersome, and "boilerplatey", not that different from redux. So, to sum up: great state management lib for smaller projects.


0
Arturs DemitersRiga, Latvia7 Ratings0 Reviews
For every complex problem there is an answer that is clear, simple, and wrong.
9 months ago

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial