Skip to content

Instantly share code, notes, and snippets.

@IsaAliev
Created February 23, 2018 19:12
Show Gist options
  • Save IsaAliev/e63afd1102ae6f8e5e489fb3421ca0d3 to your computer and use it in GitHub Desktop.
Save IsaAliev/e63afd1102ae6f8e5e489fb3421ca0d3 to your computer and use it in GitHub Desktop.
import Foundation
class ReposAPI: ReposGettable {
lazy var getReposService: BaseService<[GitHubRepo]> = {
let apiBuilder = GitHubAPIBuilder<[GitHubRepo]>()
return apiBuilder.buildAPI(for: GETReposRequest())
}()
func getRepos(completion: @escaping ([GitHubRepo]) -> ()) {
_ = getReposService.sendRequest()?.onSucces({ (repos) in
completion(repos)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment