All files / src/store store.development.js

89.47% Statements 17/19
87.5% Branches 7/8
100% Functions 2/2
87.5% Lines 14/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 391x 1x 1x 1x 1x   1x   1x 3x   1x         1x                 1x         1x   1x         1x  
import {browserHistory} from 'react-router'
import {routerMiddleware} from 'react-router-redux'
import {applyMiddleware, compose, createStore} from 'redux'
import {createLogger} from 'redux-logger'
import thunkMiddleware from 'redux-thunk'
 
import {middleware as fetch} from '../fetch'
 
import multi from './multi'
import promise from './promise'
 
const logger = createLogger({
  collapsed: true,
  duration: true
})
 
const middlewares = [
  routerMiddleware(browserHistory),
  fetch,
  multi,
  promise,
  thunkMiddleware,
  logger
]
 
Iif (process.env.LOGROCKET) {
  const LogRocket = require('logrocket')
  middlewares.push(LogRocket.reduxMiddleware())
}
// Use Redux Dev Tools to compose enhancers if available.
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
export default function configureStore (rootReducer, initialState) {
  return createStore(
    rootReducer,
    initialState,
    composeEnhancers(applyMiddleware(...middlewares))
  )
}