async actions in redux

hemanth.hm on September 03, 2018

The most common question I hear post intro to redux is: "How do I fetch some data in actions?" Most of them would hit the roadblock with: Action... [Read Full]
markdown guide
 

Great and easy to grasp examples!
In your reducer example, did you mean to write this for the FETCHING_COMIC case?:

case 'FETCHING_COMIC':
  return {
    ...state,
    loading: true
  }
 

Yeah, rather:

 case 'FETCHING_COMIC':
      return {
        ...state,
        fetching: true,
        comic: action.comic
      }
const initialState = {
  fetching: false,
  error: false,
  comic: null
}

What say?

code of conduct - report abuse