Skip to content

Instantly share code, notes, and snippets.

@techomoro
Last active Oct 6, 2021
Embed
What would you like to do?
// store/index.js
import { createStore, applyMiddleware, compose } from "redux";
import createSagaMiddleware from "redux-saga";
import rootReducer from "./reducers";
import rootSaga from "./sagas";
const sagaMiddleware = createSagaMiddleware();
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
rootReducer,
composeEnhancers(applyMiddleware(sagaMiddleware))
);
sagaMiddleware.run(rootSaga);
export default store;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment