DEV Community

Discussion on: React Redux-Sagas Starter Guide

Collapse
 
sometimescasey profile image
Casey Juanxi Li • Edited

Hey, thanks so much for this tutorial. It's almost complete...

I was wondering why the console.log("redux -> ", action.payload.data.test) line never fired to change "Hello World" to "Saga Data". I think you're actually missing the step where you connect your saga as middleware when setting up the redux store.

redux-saga.js.org/

Ctrl-F "To run our Saga, we'll have to connect it to the Redux Store using the redux-saga middleware."

One more thing - for those of us who learned to use Redux by explicitly calling dispatch() on an action, you may want to explain that you are using the Object shorthand form of mapDispatchToProps to initially dispatch getDataRequest. I had some trouble figuring out why this action was actually dispatching in componentDidMount despite the fact that I never explicitly "dispatched" it in the code.

Otherwise, helpful tut! Thanks for taking the time to write this up!