redux-saga / redux-saga-beginner-tutorial

Redux/Redux-saga beginner tutorial
MIT License
587 stars 544 forks source link

一直显示saga没有绑到store上 #51

Open lllzzzggg opened 6 years ago

lllzzzggg commented 6 years ago

Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware

lllzzzggg commented 6 years ago

const sagaMiddleware = createSagaMiddleware() const store = createStore( reducer, applyMiddleware(createSagaMiddleware(helloSaga)) ) sagaMiddleware.run(helloSaga)

astonishqft commented 5 years ago

改成下面这样就好了 const sagaMiddleware = createSagaMiddleware() const store = createStore( reducer, applyMiddleware(sagaMiddleware) ) sagaMiddleware.run(helloSaga)

wind8866 commented 5 years ago

改成下面这样就好了 const sagaMiddleware = createSagaMiddleware() const store = createStore( reducer, applyMiddleware(sagaMiddleware) ) sagaMiddleware.run(helloSaga) @astonishqft

不执行,最后一行改为sagaMiddleware.run(rootSaga)就可以了