-
Notifications
You must be signed in to change notification settings - Fork 237
home work has been done #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
home work has been done #169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Привет. Оставил пару замечаний
} | ||
|
||
override fun onStop() { | ||
if (isFinishing) { | ||
catsPresenter.detachView() | ||
CoroutineScope(Dispatchers.Main).launch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем здесь корутина?
interface ImageCatsService { | ||
|
||
@GET("meow") | ||
suspend fun getCatImage(): Response<CatImage> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем тебе Response, можно оставить просто CatImage, если будет неуспешный статус то тебе дефолтный КоллАдаптер выбросит исключение
fun onInitComplete() { | ||
presenterScope.launch { | ||
try { | ||
val response = catsService.getCatFact() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У тебя тут последовательные запросы, нужно корутины запустить
|
||
private suspend fun onInitCompleteResponse(): Result<FactAndImageModel> { | ||
return try { | ||
val response = catsService.getCatFact() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Также последовательные запросы
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.