123456789101112131415161718192021222324 |
- import { createStore, applyMiddleware } from "redux";
- import thunk from "redux-thunk";
- import createSagaMiddleware from "redux-saga";
- // import logger from "redux-logger";
- import saga from "../saga";
- import reducers from "../Reducers";
- const sagaMiddleware = createSagaMiddleware();
- const log = state => next => action => {
- console.log("PrevState", state.getState());
- next(action);
- console.log("action", action);
- console.log("nextState", state.getState());
- };
- export default createStore(
- reducers,
- // applyMiddleware(thunk, logger)
- applyMiddleware(thunk, sagaMiddleware, log)
- );
- sagaMiddleware.run(saga);
|