// @flow

import Reactotron, {
  networking,
  asyncStorage,
  trackGlobalErrors,
} from 'reactotron-react-native';
import { reactotronRedux } from 'reactotron-redux';

let reactotron = null;
if (__DEV__) {
  reactotron = Reactotron
    .configure()
    .useReactNative()
    .use(reactotronRedux())
    .use(networking())
    .use(asyncStorage())
    .use(trackGlobalErrors())
    .connect();
}

export default reactotron;

// @flow

let reactotron = null;
if (__DEV__) {
  const { default: Reactotron } = require('reactotron-react-native');
  const { reactotronRedux } = require('reactotron-redux');
  reactotron = Reactotron
    .configure()
    .useReactNative()
    .use(reactotronRedux())
    .connect();
}

export default reactotron;

Optimize reactotron usage