Skip to content

Instantly share code, notes, and snippets.

@techomoro
Last active October 6, 2021 07:42
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 techomoro/845c6a7bd074b6fe5f93ccd0d2d806e5 to your computer and use it in GitHub Desktop.
Save techomoro/845c6a7bd074b6fe5f93ccd0d2d806e5 to your computer and use it in GitHub Desktop.
// 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