yattee/Model/TrendingCountriesProvider.swift
2021-06-18 00:43:29 +02:00

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)
}
}