Skip to content

Homework for RxJava #219

Open
alexanderbatrakov wants to merge 3 commits into
Otus-Android:masterfrom
alexanderbatrakov:rx_homework
Open

Homework for RxJava #219
alexanderbatrakov wants to merge 3 commits into
Otus-Android:masterfrom
alexanderbatrakov:rx_homework

Conversation

@alexanderbatrakov
Copy link
Copy Markdown

No description provided.

})
val getFactsDisposable = getFacts().subscribe(
{ success -> _catsLiveData.value = Success(success) },
{ error -> Errors(error.toString()) }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ошибка никак не используется

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправил, спасибо

fun generateCatFact(): Single<Fact> {
return Single.never()

fun generateCatFact(): Flowable<Fact> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

должен возвращать Single по условию

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправил

fun getFacts(): Flowable<Fact> {
return Flowable
.interval(2000, TimeUnit.MILLISECONDS)
.flatMap { catsService.getCatFact() }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вот тут нужно будет использовать flatMapSingle, внутри которого onErrorResumeNext, он должен идти на каждый сетевой запрос отдельно, а не ко всему стриму

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправил

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants