Created
April 9, 2020 20:37
-
-
Save ozluy/5561d39b366d616555523a8202286c68 to your computer and use it in GitHub Desktop.
Rematch Reactotron setup for React Native
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Reactotron from 'reactotron-react-native' | |
import { reactotronRedux } from 'reactotron-redux' | |
import { AsyncStorage } from 'react-native' | |
const tron = Reactotron.configure() // AsyncStorage would either come from `react-native` or `@react-native-community/async-storage` depending on where you get it from // controls connection & communication settings | |
.useReactNative() // add all built-in react native plugins | |
.use(reactotronRedux()) // add all built-in react native plugins | |
.setAsyncStorageHandler(AsyncStorage) | |
.connect() // let's connect! | |
export default tron |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { init } from '@rematch/core' | |
import * as models from './models' | |
import config from 'common/config' | |
import Reactotron from '../../ReactotronConfig' | |
const store = init({ | |
models, | |
redux: { | |
enhancers: [Reactotron.createEnhancer()], | |
devtoolOptions: { | |
disabled: config.environment !== 'development', | |
}, | |
}, | |
}) | |
export const dispatch = store.dispatch | |
export default store |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment