Last active
February 18, 2022 16:01
-
-
Save chenzhang2006/2116ae84674549c4e053385aab9491c5 to your computer and use it in GitHub Desktop.
Extension Property: viewModelScope
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
| 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