How to use the redux-devtools.devTools function in redux-devtools

To help you get started, we’ve selected a few redux-devtools 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 py-in-the-sky / gae-flask-redux-react-starter-kit / browser_client / src / app / store / index.js View on Github external
export const createStoreWithMiddleware = () => {
    const middleware = applyMiddleware(apiMiddleware)

    if (__DEV__) {
        const logSlowReducers = require('app/utils/devLogSlowReducers')
        const reducer = combineReducers(logSlowReducers(reducers))

        const { devTools, persistState } = require('redux-devtools')

        const finalCreateStore = compose(
            middleware,
            devTools(),
            persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/))
        )(createStore)

        const store = finalCreateStore(reducer)

        if (module.hot) {  // Enable Webpack hot module replacement for reducers
            module.hot.accept('app/reducers', () => {
                const nextRootReducer = combineReducers(
                    logSlowReducers(require('app/reducers/index'))
                )
                store.replaceReducer(nextRootReducer)
            })
        }

        return store
    } else {
github banderson / generator-redux / generators / app / templates / js / store / configureStore.js View on Github external
import {createStore, applyMiddleware, combineReducers, compose} from 'redux';
import thunkMiddleware from 'redux-thunk';
import {devTools, persistState} from 'redux-devtools';
import * as reducers from '../reducers/index';

let createStoreWithMiddleware;

// Configure the dev tools when in DEV mode
if (__DEV__) {
  createStoreWithMiddleware = compose(
    applyMiddleware(thunkMiddleware),
    devTools(),
    persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/))
  )(createStore);
} else {
  createStoreWithMiddleware = applyMiddleware(thunkMiddleware)(createStore);
}

const rootReducer = combineReducers(reducers);

export default function configureStore(initialState) {
  return createStoreWithMiddleware(rootReducer, initialState);
}
github slashdotdash / phoenix-react-redux-example / web / static / js / index.js View on Github external
import createLogger from 'redux-logger';
import { compose, createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import { devTools, persistState } from 'redux-devtools';
import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react';
import App from './containers/App';
import todoApp from './reducers';

const loggerMiddleware = createLogger();

const createStoreWithMiddleware = compose(
  applyMiddleware(
    thunkMiddleware, // lets us dispatch() functions
    loggerMiddleware // neat middleware that logs actions
  ),
  devTools()
)(createStore);

const store = createStoreWithMiddleware(todoApp);

render(
  <div>
    
      
    
    
      
    
  </div>,
  document.getElementById('root')
);
github staltz / flux-challenge / submissions / winstonewert / src / index.jsx View on Github external
import React from 'react';
import {Provider} from 'react-redux';
import Root from './root';
import { compose, createStore, applyMiddleware } from 'redux';
import { devTools, persistState } from 'redux-devtools';
import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react';
import { serverMiddleware} from './server'
import '../../../styles.css'
import _ from 'lodash'
import reducer from './reducer'

const finalCreateStore = compose(
	applyMiddleware(serverMiddleware),		
	devTools(),
	persistState(window.location.href.match(/[?&amp;]debug_session=([^&amp;]+)\b/))
)(createStore);

const store = finalCreateStore(reducer);

React.render(
	<div>		
		
			{() =&gt; }
		
		
			
		
	</div>,
	document.getElementById('app')
);
github albertfdp / react-podio-universal / src / redux / create.js View on Github external
export default function(client, data) {
  const middleware = createMiddleware(client);
  let __createStore;
  if (__DEV__ && __CLIENT__ && __DEVTOOLS__) {
    const { devTools, persistState } = require('redux-devtools');
    __createStore = compose(
      applyMiddleware(middleware),
      devTools(),
      persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)),
      createStore
    );
  } else {
    __createStore = applyMiddleware(middleware)(createStore);
  }
  return __createStore(reducer, data);
}
github bgrsquared / d3-react-squared-dogs-blog / app / main.js View on Github external
children: PropTypes.object,
};

const routes = (
  
    }
    }
  
);

const store = compose(
  reduxReactRouter({
    routes,
    createHistory,
  }),
  devTools()
)(createStore)(reducer);

class Root extends Component {
  constructor() {
    super();
    this.state = {
      showDebug: false,
    };
  }

  render() {
    const {showDebug} = this.state;
    const debug = [];
    const debugButton = [];
    if (__DEVTOOLS__) {
      debugButton.push(
github junishitsuka / flasher-desktop / app / js / src / store / configStore.js View on Github external
import { createStore, applyMiddleware, compose } from "redux";
import { devTools, persistState } from 'redux-devtools';
import RootReducer from "../reducers/RootReducer";
import thunk from "redux-thunk";
import createLogger from "redux-logger";
import { createHistory } from "history";
import { routerStateReducer, reduxReactRouter } from "redux-router";

const logger = createLogger();
const createAppStore = compose(
    applyMiddleware(thunk, logger),
    devTools(),
    persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)),
    reduxReactRouter({createHistory})
)(createStore);

export default function configStore() {
    return createAppStore(RootReducer);
}
github redbooth / backbone-redux / examples / todomvc / index.js View on Github external
function createReduxStore() {
  const finalCreateStore = compose(devTools())(createStore);
  return finalCreateStore(() => {});
}
github zetkin / universal-react-redux-boilerplate / src / reducers / index.js View on Github external
function message(state = 'Hello world!', action) {
    switch (action.type) {
        case SET_MESSAGE:
            return action.message;
        default:
            return state;
    }
}

export const appState = combineReducers({
    message
});

export const finalCreateStore = compose(
    devTools()
)(createStore);
github jhen0409 / react-chrome-extension-boilerplate / app / injectpage / configureStore.js View on Github external
import { applyMiddleware, createStore, combineReducers, compose } from 'redux';
import { devTools, persistState } from 'redux-devtools';
import rootReducer from './reducers/index';
import thunk from 'redux-thunk';

const middlewares = applyMiddleware(thunk);
let finalCreateStore;
if (process.env.DEVTOOLS) {
  finalCreateStore = compose(
    middlewares,
    devTools(),
    persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)),
  )(createStore);
} else {
  finalCreateStore = compose(
    middlewares
  )(createStore);
}

export default function(initialState) {
  const store = finalCreateStore(rootReducer, initialState);

  if (module.hot) {
    module.hot.accept('./reducers', () => {
      const nextRootReducer = require('./reducers/index');
      store.replaceReducer(nextRootReducer);
    });