Skip to content

Instantly share code, notes, and snippets.

@chenzhang2006
Last active Feb 18, 2022
Embed
What would you like to do?
Extension Property: viewModelScope
public val ViewModel.viewModelScope: CoroutineScope
get() {
...
return setTagIfAbsent(
JOB_KEY,
CloseableCoroutineScope(SupervisorJob() + Dispatchers.Main)
)
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment