Skip to content

Instantly share code, notes, and snippets.

@dangthaison91
Last active June 1, 2016 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dangthaison91/309ca0e2fcb2a22fd6c37dc957f5a14c to your computer and use it in GitHub Desktop.
Save dangthaison91/309ca0e2fcb2a22fd6c37dc957f5a14c to your computer and use it in GitHub Desktop.
// Fire API request
searchBar
.rx_text
.throttle(0.5, scheduler: MainScheduler.instance)
.distinctUntilChanged()
.filter { $0.characters.count > 0 }
.flatMapLatest { findRepository($0).retry(3) }
.flatMapLatest { repository -> [Issue] in
return findIssues(repository)
}
.filterNull()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment