DrEpico / weather-app

For practicing API
0 stars 0 forks source link

Show weather using IP address on load. #10

Closed DrEpico closed 2 months ago

DrEpico commented 2 months ago

I can't think of a way to call functions to append weather data wihtout getting the error. image getLocation gets location and calls getWeather, it all works and fetch data. However when I try to use any of the "append" functions it starts running into problems. image

DrEpico commented 2 months ago

FIX:

To ensure that the append functions only run after getLocation and getWeather have successfully fetched the data, these append functions should be called inside the getLocation function. This way, they will be executed only after the data is available.

Refactor: Ensure getLocation and getWeather fetch and store the weather data properly. Only call the append functions after the data is fetched and ready. image image