Last active
October 22, 2023 16:57
-
-
Save af2905/c3e5265b606743e2a04dbefd082a48de to your computer and use it in GitHub Desktop.
lifecycle_scope_extention
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
/** | |
* [CoroutineScope] tied to this [LifecycleOwner]'s [Lifecycle]. | |
* | |
* This scope will be cancelled when the [Lifecycle] is destroyed. | |
* | |
* This scope is bound to | |
* [Dispatchers.Main.immediate][kotlinx.coroutines.MainCoroutineDispatcher.immediate]. | |
*/ | |
public val LifecycleOwner.lifecycleScope: LifecycleCoroutineScope | |
get() = lifecycle.coroutineScope |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment