easy-peasy

Vegetarian friendly state for React

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
easy-peasy
5,017106.0.46 months ago6 years agoMinified + gzip package size for easy-peasy in KB

Readme

 

Vegetarian friendly state for React

 

npm MIT License 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 ```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>
); } ```

 

Examples 📚

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

 

Core Team 🛠

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

 

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.
<img src="https://opencollective.com/easy-peasy/backers.svg?width=950" />

 

Documentation

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

 

OS Awards Nominee

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