Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork416
rematch/rematch
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Rematch is Redux best practices without the boilerplate. No more action types, action creators, switch statements or thunks in less than 1.4 kilobytes.
Redux is an amazing state management tool, supported by a healthy middleware ecosystem and excellent devtools.Rematch builds upon Redux by reducing boilerplate and enforcing best practices. It provides the following features:
- No configuration needed
- Reduces Redux boilerplate
- Built-in side-effects support
- React Devtools support
- TypeScript support
- Supports dynamically adding reducers
- Supports hot-reloading
- Allows to create multiple stores
- Supports React Native
- Extendable with plugins
- Many plugins available out of the box:
- for persisting data withredux-persist
- for wrapping state withimmer.js
- for creating selectors withreselect
- ...and others
In a few lines you can get easily asynchronous calls to an external API and data stored globally. It's amazing, with Redux you will needs tons of boilerplate, libraries and extra configuration.
typePlayersState={players:PlayerModel[]}exportconstplayers=createModel<RootModel>()({state:{players:[],}asPlayersState,reducers:{SET_PLAYERS:(state:PlayersState,players:PlayerModel[])=>{return{ ...state, players,}},},effects:(dispatch)=>{const{ players}=dispatchreturn{asyncgetPlayers():Promise<any>{letresponse=awaitfetch('https://www.balldontlie.io/api/v1/players')let{ data}:{data:PlayerModel[]}=awaitresponse.json()players.SET_PLAYERS(data)},}},})
Check it out,right now!
| Redux | Rematch | |
|---|---|---|
| simple setup | ✔ | |
| less boilerplate | ✔ | |
| readability | ✔ | |
| configurable | ✔ | ✔ |
| redux devtools | ✔ | ✔ |
| generated action creators | | ✔ |
| async | thunks | async/await |
Migrating from Redux to Rematch may only involve minor changes to your state management, and no necessary changes to your view logic. See themigration reference for the details.
Rematch and its internals are all built upon a plugin pipeline. As a result, developers can make complex custom plugins that modify the setup or add data models, often without requiring any changes to Rematch itself. See theplugins developed by the Rematch team or theAPI for creating plugins.
- Create aGitHub issue for bug reports, feature requests, or questions
- Add a ⭐️star on GitHub to support the project!
Thank you to all the people who have already contributed to rematch!
Made withcontributors-img.
This project is licensed under theMIT license.
About
The Redux Framework
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.
Packages0
Uh oh!
There was an error while loading.Please reload this page.