2019-06-19 15:38:21 -04:00
|
|
|
import { createStore, applyMiddleware, compose } from 'redux'
|
|
|
|
import rootReducer from '../reducers/index'
|
|
|
|
import { forbiddenWordsMiddleware } from '../middleware'
|
2019-06-19 22:37:59 -04:00
|
|
|
import createSagaMiddleware from "redux-saga"
|
|
|
|
import apiSaga from "../sagas/api-saga"
|
2019-06-19 14:24:21 -04:00
|
|
|
|
2019-06-19 22:37:59 -04:00
|
|
|
const initialiseSagaMiddleware = createSagaMiddleware()
|
2019-06-19 15:38:21 -04:00
|
|
|
const storeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
|
|
|
|
|
|
|
|
const store = createStore(
|
|
|
|
rootReducer,
|
2019-06-19 22:37:59 -04:00
|
|
|
storeEnhancers(applyMiddleware(forbiddenWordsMiddleware, initialiseSagaMiddleware))
|
2019-06-19 15:38:21 -04:00
|
|
|
)
|
2019-06-19 14:24:21 -04:00
|
|
|
|
2019-06-19 22:37:59 -04:00
|
|
|
initialiseSagaMiddleware.run(apiSaga)
|
|
|
|
|
2019-06-19 14:24:21 -04:00
|
|
|
export default store
|