mirror of
https://github.com/yattee/yattee.git
synced 2024-11-12 17:18:22 +00:00
19 lines
369 B
Swift
19 lines
369 B
Swift
import Alamofire
|
|
import Foundation
|
|
import SwiftyJSON
|
|
|
|
final class TrendingCountriesProvider: DataProvider {
|
|
@Published var countries = [Country]()
|
|
|
|
private var query: String = ""
|
|
|
|
func load(_ query: String) {
|
|
guard query != self.query else {
|
|
return
|
|
}
|
|
|
|
self.query = query
|
|
countries = Country.search(query)
|
|
}
|
|
}
|