Skip to content

Переход на корутины#275

Open
malinaalina wants to merge 2 commits intoOtus-Android:developmentfrom
malinaalina:development
Open

Переход на корутины#275
malinaalina wants to merge 2 commits intoOtus-Android:developmentfrom
malinaalina:development

Conversation

@malinaalina
Copy link

  • Переход на корутины в CatsPresenter
  • Добавлен запрос и отображение изображения вместе с фактом о котах
  • Создана CatsViewModel

CrashMonitor.trackWarning()
handelError(throwable)
}
private var _catsView: ICatsView? = null

Choose a reason for hiding this comment

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

вьюмодель не должна держать ссылку и вообще знать ничего про вью

}
}

fun attachView(catsView: ICatsView) {

Choose a reason for hiding this comment

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

это не нужно

CrashMonitor.trackWarning()
val errorMsg = when (e) {
is java.net.SocketTimeoutException -> "Не удалось получить ответ от сервером"
is CancellationException -> ""

Choose a reason for hiding this comment

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

нужно пробросить дальше, иначе сломается отмена
is CancellationException -> throw e

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