https://github.com/valerybugakov/mobx-redux-example
https://github.com/valerybugakov/mobx-redux-example
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/valerybugakov/mobx-redux-example
- Owner: valerybugakov
- Created: 2017-06-16T18:31:17.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-24T20:17:12.000Z (almost 9 years ago)
- Last Synced: 2025-12-19T14:39:42.058Z (6 months ago)
- Language: JavaScript
- Size: 89.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Mobx-Redux example
```sh
yarn
yarn start
```
## Idea
Handle complex parts of the Redux architecture automatically with `Mobx`, such as keeping minimal number of
re-renders after store updates by normalizing data, writing complex selectors and connecting data in the right place.
- Component updates are managed by `mobx` observables automatically - minimal re-renders out of the box
- State is mutable (no referential transparency needed)
- Use lazy `computed` properties instead of selectors to prepare data for components
- Still one way data flow via Redux actions/store/reducers with all ecosystem available
## Differences in code vs classic Redux
- State properties should be wrapped in `observable` provided by `mobx`
- Use simple mutations in reducers instead of immutable operations
- `@inject` instead of of `connect` from react-redux
- `@observer` for change detection in dumb components
## Libraries
- Add `mobx` and `mobx-react`
- Remove `react-redux`, probably `reselect` too