mirror of
https://github.com/yattee/yattee.git
synced 2024-12-15 23:00:32 +05:30
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)
|
|
}
|
|
}
|