Advertisement
Guest User

Error

a guest
Nov 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /** ReactotronConfig.js **/
  2. import Reactotron from 'reactotron-react-native';
  3. import sagaPlugin from 'reactotron-redux-saga';
  4.  
  5. if (__DEV__) {
  6.   const tron = Reactotron.configure({
  7.     host: '192.168.25.6',
  8.   }) // controls connection & communication settings
  9.     .useReactNative() // add all built-in react native plugins
  10.     .use(sagaPlugin())
  11.     .connect(); // let's connect!
  12.  
  13.   tron.clear();
  14.  
  15.   console.tron = tron;
  16. }
  17.  
  18.  
  19.  
  20. /** store.js  **/
  21. import { createStore, applyMiddleware, compose } from 'redux';
  22. import createSagaMiddleware from 'redux-saga';
  23.  
  24. import rootSaga from './sagas';
  25. import reducers from './ducks';
  26.  
  27. const middleware = [];
  28. const enhancers = [];
  29.  
  30. /* Saga */
  31. const sagaMonitor = __DEV__ ? console.tron.createSagaMonitor() : null;
  32. const sagaMiddleware = createSagaMiddleware({ sagaMonitor });
  33. middleware.push(sagaMiddleware);
  34.  
  35. enhancers.push(applyMiddleware(...middleware));
  36.  
  37. /* Store */
  38. const createAppropriateStore = __DEV__ ? console.tron.createStore : createStore;
  39. const store = createAppropriateStore(reducers, compose(...enhancers));
  40.  
  41. /* Run Saga */
  42. sagaMiddleware.run(rootSaga);
  43.  
  44. export default store;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement