redux-store.js 745 B

123456789101112131415161718192021222324
  1. import { createStore, combineReducers, applyMiddleware } from 'redux';
  2. import { authReducer } from './auth-reducer';
  3. import { myProfileReducer } from './myProfile-reducer';
  4. import { postsFeedReducer } from './postFeed-reducer';
  5. import { promiseReducer } from './promise-reducer';
  6. import createSagaMiddleware from 'redux-saga'
  7. import { rootSaga } from './saga';
  8. import { actionFullAboutMe } from '../actions'
  9. const sagaMiddleware = createSagaMiddleware()
  10. const store = createStore(combineReducers({
  11. auth: authReducer,
  12. promise: promiseReducer,
  13. myData: myProfileReducer,
  14. postsFeed: postsFeedReducer,
  15. }),
  16. applyMiddleware(sagaMiddleware))
  17. sagaMiddleware.run(rootSaga)
  18. store.dispatch(actionFullAboutMe())
  19. export default store;