Created
January 13, 2017 15:10
-
-
Save gorozco58/2168cc8b16f1292b0f1eb82840e2c972 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
import RxCocoa | |
import RxSwift | |
import Alamofire | |
//this protocol represents a repository view model then anyone can implement this and perform the fetch. | |
protocol RepositoryViewModelType { | |
func fetchRepositories(for observableText: Observable<String>) -> Driver<Result<[Repository]>> | |
} | |
struct RepositoryViewModel : RepositoryViewModelType { | |
func fetchRepositories(for observableText: Observable<String>) -> Driver<Result<[Repository]>> { | |
return RepositoryNetworking | |
.fetchRepositories(for: observableText) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment