Last active
June 27, 2019 11:18
-
-
Save mecid/030882d4fb902d0aaa30eebd11b3a19e 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
@Published private var query: String = "" | |
private func fetchRepos(matching query: String) { | |
$query.flatMap { | |
self.githubService | |
.search(matching: $0) | |
.replaceError(with: []) | |
} | |
.subscribe(on: DispatchQueue.global()) | |
.receive(on: OperationQueue.main) | |
.assign(to: \.repos, on: self) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment