Created
October 14, 2020 19:08
-
-
Save raulh82vlc/6068218bd15d45fd5199b95395eca545 to your computer and use it in GitHub Desktop.
StateFlowHandler cancels scope
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
@ActivityScope | |
class StateFlowHandler @Inject constructor(taskThreading: TaskThreading) { | |
private val scope = CoroutineScope(taskThreading.ui() + SupervisorJob()) | |
private var tweetsListUI: TweetsListUI? = null | |
// ... | |
fun cancel() { | |
scope.cancel() | |
tweetsListUI = null | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment