Swarnim01 / Movie_Listing_Webapp

https://movielistingapp.herokuapp.com/
1 stars 13 forks source link

Added loader #31

Closed kailash360 closed 3 years ago

kailash360 commented 3 years ago

I have added an animated loader for the app. This is how it will look. image

Closes #30

Swarnim01 commented 3 years ago

@kailash360 . Looking great ! Change in movie.js of using await keyword in front of fetch doesn't make sense. fetch itself returns a promise and .then() works only after a promise is resolved. So putting an await keyword in front of fetch is of no use. You can read more about it here : https://dmitripavlutin.com/javascript-fetch-async-await/

Also async functions cannot be used like this inside useffect. You need to make a separate async function inside useffect and call it there itself. You can get more idea here : https://dmitripavlutin.com/javascript-fetch-async-await/

Make necessary changes and make a PR again.

kailash360 commented 3 years ago

@Swarnim01, I have made the changes as asked. Kindly take a look.

Swarnim01 commented 3 years ago

Great ! I hope you went through the given resources and must've understood async-await and useffect usage with async functions.