Skip to content

Instantly share code, notes, and snippets.

@gtokman
Last active October 6, 2021 18:18
Show Gist options
  • Save gtokman/ff914326d521c8a6594006f88959ebc9 to your computer and use it in GitHub Desktop.
Save gtokman/ff914326d521c8a6594006f88959ebc9 to your computer and use it in GitHub Desktop.
struct ViewModel {
let apiService: ApiService
let locationService: LocationService // fetch location data
/// Fetch businesses from service for term
func getBusinesses(for term: String) async throws -> [Business] {
return try
await apiService
.businesses(
.search(term: term, location: locationService.current())
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment