Skip to content

Tag: async-await

Getting an array of Promises after async await

i’m trying to create an array of the daily forecast mapping over an array with cities. I’m trying to map over the array of the cities making an api call for each one of them once the page loads. I keep on getting an array of Promises such as this : Favorite Page component: Service with the api cal…

Difference betweeen Two line of same code

can someone explain to me the differenec between the two line of code. In my atom editor the prettier changes the first to second. and Answer Prettier changes the whole thing to follow the rules given in a Prettier config file. In your specific case, the (await fetchSearchResults(state.requestConfig, context)…

await operator is being skipped

Could you please help me with an issue I am facing? I have attached my code below, after button click, it catches an error (if there is) but skips Which means it just jumps to catch (e). I need it to reload my grid first. Thank you for any advise. Answer If it skips over your code like that, chances

React API not showing the data

I am not able to retrieve content from API every time I reload my page it shows error, please see the attached image, I wanted to find the weather details using Weather API and right now I am using static latitude and longitude. https://i.stack.imgur.com/oqr7i.jpg Answer The problem with your code is that you…