Skip to content

Instantly share code, notes, and snippets.

@myself379
Forked from jperelli/store-config.js
Created March 15, 2019 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myself379/4869bf19bb9961edc8e0db5c6377d90c to your computer and use it in GitHub Desktop.
Save myself379/4869bf19bb9961edc8e0db5c6377d90c to your computer and use it in GitHub Desktop.
Reactotron + redux + react-native configuration
import Reactotron from 'reactotron-react-native'
import { reactotronRedux } from 'reactotron-redux'
var store;
if (__DEV__) {
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