import { applyMiddleware, compose, createStore } from 'redux'
import { createHistory } from 'history'
import { syncHistory } from 'react-router-redux'
import thunk from 'redux-thunk'

import devToolsExtension from './devToolsExtension'
import reducer from 'reducers'

export const history = createHistory()

const reduxRouterMiddleware = syncHistory(history)

const store = createStore(reducer,
  compose(
    applyMiddleware(thunk, reduxRouterMiddleware),
    devToolsExtension
  )
)

if (module.hot) {
  module.hot.accept('../reducers', () => {
    const nextReducer =
      require('../reducers').default // eslint-disable-line global-require

    store.replaceReducer(nextReducer)
  })
}

reduxRouterMiddleware.listenForReplays(store)

export default store

import { applyMiddleware, compose, createStore } from 'redux'
import { createHistory } from 'history'
import { syncHistory } from 'react-router-redux'
import { apiMiddleware } from 'redux-api-middleware'
import thunk from 'redux-thunk'

import devToolsExtension from './devToolsExtension'
import reducer from 'reducers'

export const history = createHistory()

const reduxRouterMiddleware = syncHistory(history)

const store = createStore(reducer,
  compose(
    applyMiddleware(thunk, reduxRouterMiddleware, apiMiddleware),
    devToolsExtension
  )
)

if (module.hot) {
  module.hot.accept('../reducers', () => {
    const nextReducer =
      require('../reducers').default // eslint-disable-line global-require

    store.replaceReducer(nextReducer)
  })
}

reduxRouterMiddleware.listenForReplays(store)

export default store

Include API middleware in the store
Include API middleware in the store

I missed this step when I added redux-api-middleware to the project in
#24.
