How to use the reactotron-react-native.createStore function in reactotron-react-native

To help you get started, we’ve selected a few reactotron-react-native examples, based on popular ways it is used in public projects.

github anchetaWern / RNPokeBattle / Root.js View on Github external
import BattleScreen from "./src/screens/BattleScreen";
import TeamSelectionScreen from "./src/screens/TeamSelectionScreen";

import { Provider } from "react-redux";
import { compose, createStore } from "redux";
import reducers from "./src/reducers";

import Reactotron from "reactotron-react-native";
import { reactotronRedux } from "reactotron-redux";

Reactotron.configure({ host: "YOUR_INTERNAL_IP_ADDRESS" }) // example: 192.168.254.108
  .useReactNative()
  .use(reactotronRedux())
  .connect();

const store = Reactotron.createStore(reducers, {}, compose());

//const store = createStore(reducers); // replace the above code with this one on deployment

console.ignoredYellowBox = ["Setting a timer"];

const RootStack = createStackNavigator(
  {
    Login: LoginScreen,
    TeamSelect: TeamSelectionScreen,
    Battle: BattleScreen
  },
  {
    initialRouteName: "Login"
  }
);
github squatsandsciencelabs / OpenBarbellApp / app / redux / Store.js View on Github external
export default initializeStore = () => {
    // create the store
    if (__DEV__) {
        // reactotron development mode
        const sagaMonitor = Reactotron.createSagaMonitor();
        var sagaMiddleware = createSagaMiddleware({sagaMonitor});
        const middlewares = applyMiddleware(
            thunk,
            sagaMiddleware
        );
        const enhancers = compose(middlewares, autoRehydrate());        
        var store = Reactotron.createStore(reducers, enhancers);
    } else {
        // release mode
        var sagaMiddleware = createSagaMiddleware();
        const middlewares = applyMiddleware(
            thunk,
            sagaMiddleware
        );
        const enhancers = compose(middlewares, autoRehydrate());        
        var store = createStore(reducers, enhancers);
    }

    // run sagas
    sagaMiddleware.run(Sagas);
    
    // load previous
    if (Platform.OS === 'ios') {
github squatsandsciencelabs / OpenBarbellApp / app / redux / Store.js View on Github external
export default initializeStore = () => {
    // create the store
    if (__DEV__) {
        // reactotron development mode
        const sagaMonitor = Reactotron.createSagaMonitor();
        var sagaMiddleware = createSagaMiddleware({sagaMonitor});
        const middlewares = applyMiddleware(
            thunk,
            sagaMiddleware
        );
        const enhancers = compose(middlewares, autoRehydrate());        
        var store = Reactotron.createStore(reducers, enhancers);
    } else {
        // release mode
        var sagaMiddleware = createSagaMiddleware();
        const middlewares = applyMiddleware(
            thunk,
            sagaMiddleware
        );
        const enhancers = compose(middlewares, autoRehydrate());        
        var store = createStore(reducers, enhancers);
    }

    // run sagas
    sagaMiddleware.run(Sagas);
    
    // load previous
    persistStore(store, {
github thiagobrez / react-native-template-pro / src / store.js View on Github external
import {createStore, applyMiddleware} from 'redux';
import Reactotron from 'reactotron-react-native';
import createSagaMiddleware from 'redux-saga';
import reducers from './reducers';
import rootSaga from './sagas';

/**
 * Reactotron linking for Redux-Saga.
 */
const sagaMonitor = Reactotron.createSagaMonitor();
const sagaMiddleware = createSagaMiddleware({sagaMonitor});

/**
 * Redux store creation.
 */
const store = Reactotron.createStore(
	reducers,
	applyMiddleware(sagaMiddleware)
);

/**
 * Starts root saga listener.
 */
sagaMiddleware.run(rootSaga);

export default store;
github gitpoint / git-point / root.store.js View on Github external
const middlewares = [reduxThunk];

  if (__DEV__) {
    if (process.env.LOGGER_ENABLED) {
      middlewares.push(createLogger());
    }
  }

  return applyMiddleware(...middlewares);
};

let store;

if (__DEV__) {
  if (process.env.TRON_ENABLED) {
    store = Reactotron.createStore(
      rootReducer,
      compose(getMiddleware())
    );
  } else {
    store = createStore(
      rootReducer,
      composeWithDevTools(getMiddleware())
    );
  }
} else {
  store = createStore(rootReducer, compose(getMiddleware()));
}

export const configureStore = store;
export const persistor = persistStore(configureStore);
github Kamahl19 / react-starter / rnmobile / src / app / store / configureStore.dev.js View on Github external
export default function configureStore() {
  const sagaMiddleware = createSagaMiddleware({
    sagaMonitor: Reactotron.createSagaMonitor(),
  });

  const persistedReducer = persistReducer(
    {
      key: 'root',
      storage: AsyncStorage,
      whitelist: ['auth'],
      debug: true,
    },
    rootReducer
  );

  const store = Reactotron.createStore(
    persistedReducer,
    compose(applyMiddleware(sagaMiddleware, logger))
  );

  const persistor = persistStore(store);

  sagaMiddleware.run(rootSaga);

  return { store, persistor };
}
github andrewnaeve / react-native-MineMeal / app / store.js View on Github external
import { createStore, applyMiddleware, compose } from 'redux';
import { Platform } from 'react-native';
import rootReducer from './reducers/index';
import thunk from 'redux-thunk';
import initialState from './initial-state';
import { startListeningToAuthChanges } from './actions/auth';
import devTools from 'remote-redux-devtools';
import Reactotron from 'reactotron-react-native';
export const store = Reactotron.createStore(
  rootReducer,
  initialState,
  applyMiddleware(thunk),
);
github SkyzohKey / M-Droid / src / App.js View on Github external
constructor(props) {
    super(props);

    const middlewares = [thunk];

    this.store = Reactotron.createStore(
      getRootReducer(navigationReducer),
      {},
      composeWithDevTools(applyMiddleware(...middlewares))
    );
  }