Skip to content

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

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

sergeyolshanov
Copy link

No description provided.

Copy link
Collaborator

@antonkazakov antonkazakov left a 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 {
Copy link
Collaborator

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>
Copy link
Collaborator

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()
Copy link
Collaborator

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()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Также последовательные запросы

Copy link
Collaborator

@antonkazakov antonkazakov left a comment

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