Last active
October 6, 2021 18:18
-
-
Save gtokman/ff914326d521c8a6594006f88959ebc9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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