How to use the redux-devtools-extension/logOnlyInProduction.composeWithDevTools function in redux-devtools-extension

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

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codeBelt / react-redux-architecture / src / stores / rootStore.js View on Github external
export default (initialState, history) => {
  const middleware = [environment.isDevelopment ? reduxFreeze : null, thunk, routerMiddleware(history), errorToastMiddleware()].filter(Boolean);

  const store = createStore(rootReducer(history), initialState, composeWithDevTools(applyMiddleware(...middleware)));

  // store.subscribe(() => console.log(store.getState()));

  return store;
};
github interledger-deprecated / ilp-kit / client / src / redux / store.js View on Github external
export default function createFinalStore (client, history) {
  const middleware = [
    routerMiddleware(history),
    createClientMiddleware(client),
    // loadingBarMiddleware({ promiseTypeSuffixes: ['PENDING', 'SUCCESS', 'FAIL'] })
  ]

  return createStore(reducers, composeWithDevTools(applyMiddleware(...middleware)))
}
github explooosion / browndust-share / src / index.js View on Github external
import thunk from 'redux-thunk';
import { ThemeProvider } from 'styled-components';
import './index.scss';
import './i18n';
import reducers from './reducers';
import App from './App';

// eslint-disable-next-line import/no-webpack-loader-syntax
const theme = require('sass-extract-loader?{"plugins":["sass-extract-js"]}!./scss/_index.scss');

/* eslint-disable no-underscore-dangle */
// const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

const store = createStore(
  reducers,
  composeWithDevTools(
    applyMiddleware(thunk),
  ));
/* eslint-enable */

ReactDOM.render(
  
    
      
    
  ,
  document.getElementById('root')
);
github freeCodeCamp / freeCodeCamp / client / src / redux / createStore.js View on Github external
const clientSide = isBrowser();

const sagaMiddleware = createSagaMiddleware({
  context: {
    document: clientSide ? document : {}
  }
});
const epicMiddleware = createEpicMiddleware({
  dependencies: {
    window: clientSide ? window : {},
    location: clientSide ? window.location : {},
    document: clientSide ? document : {}
  }
});

const composeEnhancers = composeWithDevTools({
  // options like actionSanitizer, stateSanitizer
});

export const createStore = () => {
  const store = reduxCreateStore(
    rootReducer,
    composeEnhancers(applyMiddleware(sagaMiddleware, epicMiddleware))
  );
  sagaMiddleware.run(rootSaga);
  epicMiddleware.run(rootEpic);
  if (module.hot) {
    // Enable Webpack hot module replacement for reducers
    module.hot.accept('./rootReducer', () => {
      const nextRootReducer = require('./rootReducer');
      store.replaceReducer(nextRootReducer);
    });
github CodeChain-io / codechain-web-wallet / src / index.tsx View on Github external
});

    // Apply middleware to proxy store
    const middleware = [thunk, logger];
    const storeWithMiddleware = applyMiddlewareChrome(store, ...middleware);

    store.ready().then(() => {
        ReactDOM.render(
            
                
            ,
            document.getElementById("root") as HTMLElement
        );
    });
} else {
    const composeEnhancers = composeWithDevTools({});
    const store = createStore(
        rootReducer,
        composeEnhancers(applyMiddleware(thunk))
    );
    ReactDOM.render(
        
            
        ,
        document.getElementById("root") as HTMLElement
    );
}

unregister();
github tai2 / webpacker-react-example / app / assets / javascripts / todos / store / index.ts View on Github external
export default function createAppStore(
  preloadedState: Partial
): Store {
  const sagaMiddleware = createSagaMiddleware()
  const enhancer = composeWithDevTools(applyMiddleware(sagaMiddleware))

  const store = createStore(reducers, preloadedState as StoreState, enhancer)

  sagaMiddleware.run(rootSaga)

  return store
}
github codeBelt / typescript-hapi-react-hot-loader-example / src / utilities / ProviderUtility.ts View on Github external
public static createProviderStore(initialState: Partial = {}, history: History = null, isServerSide: boolean = false): ISagaStore {
        const sagaMiddleware: SagaMiddleware = createSagaMiddleware();

        const middleware: Middleware[] = [
            (isProduction || isServerSide) ? null : reduxFreeze,
            routerMiddleware(history),
            sagaMiddleware,
        ].filter(Boolean);

        const store: any = createStore(
            rootReducer(history),
            initialState,
            composeWithDevTools(
                applyMiddleware(...middleware),
            ),
        );

        if (isServerSide) {
            store.runSaga = sagaMiddleware.run;
            store.endSaga = () => store.dispatch(END);
        } else {
            sagaMiddleware.run(rootSaga);
        }

        return store;
    }
github johndatserakis / koa-react-notes-web / src / store / index.js View on Github external
import { applyMiddleware, combineReducers, createStore } from 'redux'
    import { composeWithDevTools } from 'redux-devtools-extension/logOnlyInProduction';
import thunk from 'redux-thunk';
import userReducer from 'store/reducers/userReducer'
import notesReducer from 'store/reducers/notesReducer'

const allReducers = combineReducers({
    user: userReducer,
    notes: notesReducer
})

const compose = composeWithDevTools({})

const middleware = compose(
    applyMiddleware(thunk)
)

const store = createStore(allReducers, {}, middleware)

export default store