Mobx middleware for flipper
npm install mobx-flipperflipper-plugin-mobx-debugger allows you read React Native mobx logs inside Flipper now:
- Action
- State comparison
1. Install mobx-flipper middleware and react-native-flipper in your React Native app:
``bash`
yarn add mobx-flipper react-native-flipperfor iOS
cd ios && pod install
2. Add the middleware:
- MobX
`javascript
import {spy} from 'mobx';
import {createMobxDebugger} from 'mobx-flipper';
const store = new Store(); // your store
if (__DEV__) {
spy(createMobxDebugger(store));
}
`
- MobX-state-tree
`javascript
import {addMiddleware} from 'mobx-state-tree';
import {createMstDebugger} from 'mobx-flipper';
const store = new Store(); // your store
if (__DEV__) {
addMiddleware(store, createMstDebugger(store));
}
`
3. Install flipper-plugin-mobx-debugger in Flipper desktop client:
```
Manage Plugins > Install Plugins > search "mobx-debugger" > Install
4. Start your app, then you should be able to see Mobx Debugger on your Flipper app
This plugin is inspired by flipper-plugin-redux-debugger.