Created
February 23, 2018 19:12
-
-
Save IsaAliev/e63afd1102ae6f8e5e489fb3421ca0d3 to your computer and use it in GitHub Desktop.
This file contains 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
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