Created
January 21, 2019 13:50
-
-
Save vvsevolodovich/16219bc4a15ed1f55eb755fb2bcf5c9d to your computer and use it in GitHub Desktop.
RxJava Search
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
publishSubject | |
.debounce(300, TimeUnit.MILLISECONDS) | |
.distinctUntilChanged() | |
.switchMap { | |
searchQuery -> apiClientRxImpl.searchRepositories(searchQuery) | |
} | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe({ | |
repos.adapter = ReposAdapter( | |
it.map { it.full_name }, | |
this@RepositoriesActivity) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment