-
-
Save wwwjsw/9877c27d19543c56b64bf303a134d2f4 to your computer and use it in GitHub Desktop.
Reactotron + redux + react-native configuration
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 Config from '../Config/DebugConfig' | |
| import Immutable from 'seamless-immutable' | |
| import Reactotron from 'reactotron-react-native' | |
| import { reactotronRedux } from 'reactotron-redux' | |
| import sagaPlugin from 'reactotron-redux-saga' | |
| var store; | |
| if (Config.useReactotron) { | |
| Reactotron | |
| .configure({ name: 'VTX-sharepoint' }) | |
| .use(reactotronRedux()) | |
| .connect() | |
| // monkey patch console.log to send log to reactotron | |
| const yeOldeConsoleLog = console.log | |
| console.log = (...args) => { | |
| yeOldeConsoleLog(...args) | |
| Reactotron.display({ | |
| name: 'CONSOLE.LOG', | |
| value: args, | |
| preview: args.length > 0 && typeof args[0] === 'string' ? args[0] : null | |
| }) | |
| } | |
| store = Reactotron.createStore(rootReducer, ...middlewares) | |
| } | |
| else { | |
| store = createStore(rootReducer, ...middlewares) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment