index.js 709 B

1234567891011121314151617181920212223
  1. import React from 'react';
  2. import ReactDOM from 'react-dom';
  3. import { createLogger } from 'redux-logger';
  4. import createSagaMiddleware from 'redux-saga';
  5. import { createStore, applyMiddleware } from 'redux';
  6. import reducer, { fetchPost, watchFetchPosts } from './reducers/index';
  7. import actions from './actions';
  8. const loggerMiddleware = createLogger();
  9. const sagaMiddleware = createSagaMiddleware();
  10. const store = createStore(
  11. reducer,
  12. applyMiddleware(sagaMiddleware, loggerMiddleware)
  13. );
  14. sagaMiddleware.run(watchFetchPosts);
  15. store.dispatch(actions.fetchPosts('darksouls'));
  16. const title = <h2>Test setup</h2>;
  17. ReactDOM.render(<div>{title}</div>, document.getElementById('app'));
  18. module.hot.accept();