Skip to content

Instantly share code, notes, and snippets.

@tfcporciuncula
Last active May 1, 2023 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tfcporciuncula/5b045fd65e8ee3776b65b077685e3b06 to your computer and use it in GitHub Desktop.
Save tfcporciuncula/5b045fd65e8ee3776b65b077685e3b06 to your computer and use it in GitHub Desktop.
actual abstract class ViewModel {
actual val viewModelScope = MainScope()
protected actual open fun onCleared() {}
fun clear() {
onCleared()
viewModelScope.cancel()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment