Skip to content

Instantly share code, notes, and snippets.

@matheuscouto
Created May 22, 2019 14:07
Show Gist options
  • Save matheuscouto/a94ea4fef5408c6679353f462251d74b to your computer and use it in GitHub Desktop.
Save matheuscouto/a94ea4fef5408c6679353f462251d74b to your computer and use it in GitHub Desktop.
// 'searchData' -> What data? Describe it.
// In fact, if your are only fetching the data in this function,
// it should be named something like "fetchWeatherService"
searchData = async (searchTerm) => { // 'index' a generic name and can be anything, always describe what a variable suppose to be
const weatherApiResponse = (await fetch('link')).json();
const weatherList = watherApiResponse.list;
this.mySearchMethod(weatherList); // now this is the real search function method
}
@eroncardoso88
Copy link

Very nice, thank you for your feedback. I'll be studying your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment