Created
May 22, 2019 14:07
-
-
Save matheuscouto/a94ea4fef5408c6679353f462251d74b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// '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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very nice, thank you for your feedback. I'll be studying your code.