Guest User

Untitled

a guest
Jan 23rd, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. composeWithDevTools(applyMiddleware()) // work
  2. composeWithDevTools(applyMiddleware(thunk)) // don't work
  3.  
  4. Uncaught TypeError: Cannot call a class as a function
  5.  
  6. import { createStore, applyMiddleware } from 'redux';
  7. import { composeWithDevTools } from 'redux-devtools-extension';
  8. import thunk from 'react-thunk';
  9.  
  10. createStore(reducer, composeWithDevTools(applyMiddleware(thunk)));
  11.  
  12. import { createStore, applyMiddleware, compose } from 'redux';
  13. import { browserHistory } from 'react-router';
  14. import { routerMiddleware } from 'react-router-redux';
  15. import reducers from '../reducers/';
  16. import thunk from 'redux-thunk';
  17.  
  18. const middlewares = [thunk, routerMiddleware(browserHistory), apiMiddleware];
  19.  
  20. const enhancers = compose(
  21. applyMiddleware(...middlewares),
  22. );
  23.  
  24. const store = createStore(reducers, enhancers);
  25.  
  26.  
  27. export default store;
  28.  
  29. import thunk from 'react-thunk';
  30.  
  31. import thunk from 'redux-thunk';
Add Comment
Please, Sign In to add comment