I am trying to extract the weather app into it's own component, am just puzzled where to put the GET ... almost looks like it should be actually in islands folder and just a async function??
Whenever you want to have interactivity in your app, so like, data that changes based on user input (selecting a city in a form), islands are your friends. Depends on how you want it to behave, for this video, just having the page reload with the form data works just fine. If you don't want the page to reload, using an island is a must. In that case like you said, an island with an async function that is triggered on the form submit could execute the fetch and update the value of the weather data that is being displayed.
more videos sir hehe
I am trying to extract the weather app into it's own component, am just puzzled where to put the GET ... almost looks like it should be actually in islands folder and just a async function??
Whenever you want to have interactivity in your app, so like, data that changes based on user input (selecting a city in a form), islands are your friends. Depends on how you want it to behave, for this video, just having the page reload with the form data works just fine. If you don't want the page to reload, using an island is a must.
In that case like you said, an island with an async function that is triggered on the form submit could execute the fetch and update the value of the weather data that is being displayed.