Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@yshrsmz
Last active April 13, 2019 05:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yshrsmz/523370cf9807b62cb0f51496325a45a6 to your computer and use it in GitHub Desktop.
Save yshrsmz/523370cf9807b62cb0f51496325a45a6 to your computer and use it in GitHub Desktop.
Multiplatform ViewModel
expect abstract class ViewModel() {
open fun onCleared()
}
actual abstract class ViewModel : androidx.lifecycle.ViewModel() {
public actual override fun onCleared() {
super.onCleared()
}
}
actual abstract class ViewModel {
actual open fun onCleared() {
// no-op
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment