Skip to content

Instantly share code, notes, and snippets.

@akmur
Created March 15, 2019 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akmur/fa3fc58372418b0af19c2695a22b594d to your computer and use it in GitHub Desktop.
Save akmur/fa3fc58372418b0af19c2695a22b594d to your computer and use it in GitHub Desktop.
// importing basic redux packages
import { createStore, applyMiddleware, compose } from 'redux'
// importing our combined reducers
import combineReducers from '../reducers/index.reducers'
// importing our middleware
import { middlewareActions } from '../middleware/index.middleware'
// this is needed to be able to do ajax requests
import thunk from 'redux-thunk'
// the following line is used for the redux devtools chrome extension
const storeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
// creating the store
const store = createStore(
combineReducers,
storeEnhancers(applyMiddleware(middlewareActions, thunk))
)
// exporting the store
export default store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment