ivano
01/11/2020, 9:12 PMfun search(query: String) {
view?.showLoading()
repository.getRecipes(query, object : RepositoryCallback<List<Recipe>> {
override fun onSuccess(recipes: List<Recipe>?) {
<mailto:this@SearchResultsPresenter.recipes|this@SearchResultsPresenter.recipes> = recipes
if (recipes != null && recipes.isNotEmpty()) {
view?.showRecipes(recipes)
} else {
view?.showEmptyRecipes()
}
}
override fun onError() {
view?.showError()
}
})
}