Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork193
Vegetarian friendly state for React
License
ctrlplusb/easy-peasy
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Vegetarian friendly state for React
Easy Peasy is an abstraction of Redux, providing a reimagined API that focuses ondeveloper experience. It allows you toquickly andeasily manage your state, whilst leveraging the strongarchitectural guarantees and extensiveeco-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
Create your store
conststore=createStore({todos:['Create store','Wrap application','Use store'],addTodo:action((state,payload)=>{state.todos.push(payload);}),});
Wrap your application
functionApp(){return(<StoreProviderstore={store}><TodoList/></StoreProvider>);}
Use the store
functionTodoList(){consttodos=useStoreState((state)=>state.todos);constaddTodo=useStoreActions((actions)=>actions.addTodo);return(<div>{todos.map((todo,idx)=>(<divkey={idx}>{todo}</div>))}<AddTodoonAdd={addTodo}/></div>);}
See theexample folder for more examples of how to useeasy-peasy.
Peter Weinberg | Jørn A. Myrland | Sean Matheson |
We have only but great appreciation to those who support this project. If youhave the ability to help contribute towards the continued maintenance andevolution of this library then please consider[becoming a sponsor].
See theofficial website for tutorials, docs, recipes,and more.
Easy Peasy was nominated under the "Productivity Booster" category.
About
Vegetarian friendly state for React
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
