In this lesson, we’ll see how we can handle success and error conditions independently using next
and throw
properties in a reducerMap
with handleActions
. We’ll add calls to catch
for our fetch
calls and display error messages when we encounter an error.
Are you saying that redux-actions knows automatically to use the next and throw keys depending on if the payload is a success payload or an error payload? Or did I miss something?
Are you saying that redux-actions knows automatically to use the next and throw keys depending on if the payload is a success payload or an error payload? Or did I miss something?
Yup. If your payload is an Error
object, it will use the throw
property, anything else will be handled by next
This is so frickin cool. So this only works if you use the actionCreator right ?