Created
July 29, 2022 15:13
-
-
Save motorro/7158e613c08c2e9227165942abe1c675 to your computer and use it in GitHub Desktop.
Coroutine state
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
abstract class CoroutineState<G: Any, U: Any>: CommonMachineState<G, U>() { | |
protected val stateScope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate) | |
override fun doClear() { | |
stateScope.cancel() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment