Skip to content

Instantly share code, notes, and snippets.

@callmephilip
Created June 8, 2016 15:59
Show Gist options
  • Save callmephilip/3282646603cb4ed022197c49c82cb40d to your computer and use it in GitHub Desktop.
Save callmephilip/3282646603cb4ed022197c49c82cb40d to your computer and use it in GitHub Desktop.
// app/store.js
import { createStore, compose } from 'redux';
import { fromJS } from 'immutable';
import createReducer from './reducers';
import devTools from 'remote-redux-devtools';
function configureStore(initialState = fromJS({})) {
if (__DEV__) {
const createStoreWithMiddleware = compose(devTools())(createStore);
return createStoreWithMiddleware(createReducer(), initialState);
} else {
return createStore(createReducer(), initialState);
}
}
module.exports = configureStore;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment