Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Confusing onCleared in ViewModels #460

Open
LikeAnyan opened this issue Jun 25, 2019 · 0 comments
Open

Confusing onCleared in ViewModels #460

LikeAnyan opened this issue Jun 25, 2019 · 0 comments

Comments

@LikeAnyan
Copy link

LikeAnyan commented Jun 25, 2019

Hi everyone,
I'm found a little confuse in current app's ViewModels as there used an viewModelScope from ktx in which implementation coroutine context gets cancel on it's close. But in app's ViewModels onCleared method overriden and there viewModelScope.cancel() call could be found.
It looks like onCleared override could be cleaned up from ViewModels as viewModelScope's context cancelation handled by the lib.

references that could be useful:
ktx-viewModelScope source,
ViewModel source

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@LikeAnyan and others