fbi-cde/crime-data-frontend

View on GitHub
src/store.js

Summary

Maintainability
A
0 mins
Test Coverage
/* eslint-disable arrow-body-style */

import { applyMiddleware, createStore } from 'redux'
import createLogger from 'redux-logger'
import thunk from 'redux-thunk'

import reducer from './reducers'

const middlewares = [thunk]
if (process.env.NODE_ENV !== 'production') middlewares.push(createLogger())

const configureStore = (preloadedState = {}) => {
  return createStore(reducer, preloadedState, applyMiddleware(...middlewares))
}

export default configureStore