Oluwaseunus / anime-characters

Anime Characters Web App for a test :fire:
0 stars 0 forks source link

What happens when no anime is retrieved? #6

Closed ooade closed 5 years ago

ooade commented 5 years ago

I'm just saying. It's not like there won't be any from jikan. You don't have to change anything, but what do you think can be done here? https://github.com/Oluwaseunus/anime-characters/blob/4cf0168c6477e00e80955179d3fcfeaca4328478/src/components/Main.js#L23

Oluwaseunus commented 5 years ago

I could set a timer, and if the fetch doesn't return anything for a number of seconds that's known to be the average time of maybe 10 fetches, I could then dispatch an error action, telling the user to reload the page. This would require a new reducer to manage the error state.

ooade commented 5 years ago

Is 10 not like an overkill? :sweat_smile: It's all good, tho. Still you don't need a new reducer to manager the error state, all you need is an object like I previously mentioned with an error property :wink:

What I wanted to hear was using the loading state mentioned in a previous issue.