Last active
April 13, 2019 05:43
-
-
Save yshrsmz/523370cf9807b62cb0f51496325a45a6 to your computer and use it in GitHub Desktop.
Multiplatform ViewModel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expect abstract class ViewModel() { | |
open fun onCleared() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actual abstract class ViewModel : androidx.lifecycle.ViewModel() { | |
public actual override fun onCleared() { | |
super.onCleared() | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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