nthopinion / covid19

Code vs COVID-19: Taking down a Pandemic using machines connected globally to extinguish a biological threat of a super virus.
MIT License
42 stars 54 forks source link

Loading screen while fetching the data #55

Open shubhsk88 opened 4 years ago

shubhsk88 commented 4 years ago

When the client is fetching the data from API there is no loading screen for that

┆Issue is synchronized with this Trello card by Unito

nastikue commented 4 years ago

I've found an interesting article that can be helpful when issue is reopened https://medium.com/@Charles_Stover/react-suspense-with-the-fetch-api-a1b7369b0469

aviskarkc10 commented 4 years ago

@nastikue Not sure if we should use react suspense right away. It's not production ready yet: https://reactjs.org/docs/concurrent-mode-suspense.html

BTW have you worked with Suspense and data fetching previously?

nastikue commented 4 years ago

@aviskarkc10 I've researched Suspense for the other project and we decided not to use it there, agree that it should be used in production until it is stable.

shubhsk88 commented 4 years ago

I researched about that it as well Maybe we can do the react-infinite scrolling and fetch the data after when user slide it down in that way we don't have to get all the data at once and we can show some data and when the user slides it down we can fetch our data Please look up more about this article https://www.smashingmagazine.com/2020/03/infinite-scroll-lazy-image-loading-react/

nastikue commented 4 years ago

@shubhsk88 the article starts with "If you have been looking for an alternative to pagination", so I am guessing why not to make pagination then?

aviskarkc10 commented 4 years ago

Yeah the best option now is either implementing pagination/infinite scroll. Having this discussion on one of the slack channels and proceeding based on the decision made their should be the best way forward.