Last active
February 18, 2022 22:19
-
-
Save chenzhang2006/32150d462f123279d32e1d69a1a8d061 to your computer and use it in GitHub Desktop.
Specify coroutine name at coroutine builder
This file contains 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
viewModelScope.launch(CoroutineName("GetFavorites")) { | |
postsRepository.observeFavorites().collect { favorites -> | |
viewModelState.update { it.copy(favorites = favorites) } | |
} | |
} | |
// or within your custom coroutine scope | |
launch(CoroutineName("GetFavorites")) { | |
postsRepository.observeFavorites().collect { favorites -> | |
viewModelState.update { it.copy(favorites = favorites) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment