Skip to content

Instantly share code, notes, and snippets.

@dabit3
Created February 18, 2017 22:02
Show Gist options
  • Save dabit3/1f15667fcd8dc54133f5891039c6229b to your computer and use it in GitHub Desktop.
Save dabit3/1f15667fcd8dc54133f5891039c6229b to your computer and use it in GitHub Desktop.
Medium - redux4ways - Redux Saga configureStore.js
import { createStore, applyMiddleware } from 'redux'
import app from './reducers'
import createSagaMiddleware from 'redux-saga'
import dataSaga from './saga'
const sagaMiddleware = createSagaMiddleware()
export default function configureStore() {
const store = createStore(app, applyMiddleware(sagaMiddleware))
sagaMiddleware.run(dataSaga)
return store
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment