-
Notifications
You must be signed in to change notification settings - Fork 241
done #265
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?
done #265
Conversation
| override fun onFailure(call: Call<Fact>, t: Throwable) { | ||
| CrashMonitor.trackWarning() | ||
| catch (e: Exception) { | ||
| when (e) { |
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.
тут будет перехвачено CancellationException, что сломает механизм отмены корутин, нужно прокидывать его дальше
is CancellationException -> throw e
| _result.value = Result.Success(fact) | ||
| } | ||
| catch (e: Exception) { | ||
| CrashMonitor.trackWarning(e) |
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.
здесь тоже CancellationException
| override fun onCleared() { | ||
| super.onCleared() | ||
| detachView() | ||
| viewModelScope.cancel() |
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.
viewModelScope сам отменится, это избыточно
| private val catsService: CatsService, | ||
| private val catsServicePics: CatsServicePics | ||
| ) : ViewModel() { | ||
| private var _catsView: ICatsView? = null |
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.
тут архитектурная проблема, ViewModel в отличие от Presenter ничего не знает о View и не должна хранить на нее ссылку, вью должна сама подписаться на стейты вьюмодели и обновлять свое состояние в соответствии с ними
No description provided.