Skip to content

Instantly share code, notes, and snippets.

@raulh82vlc
Created February 28, 2021 13:25
Show Gist options
  • Save raulh82vlc/dc7971db19ab9ddae462aa4128f22722 to your computer and use it in GitHub Desktop.
Save raulh82vlc/dc7971db19ab9ddae462aa4128f22722 to your computer and use it in GitHub Desktop.
SearchStateHandler StateFlow collection
@ActivityScope
class SearchStateHandler @Inject constructor(
@Named("CoroutineUIScope") private val scope: CoroutineScope
) {
private lateinit var stateFlow: StateFlow<TweetsUIState>
fun processStateCollection() {
stateFlow.onEach { uiState ->
tweetsListUI?.handleStates(uiState)
}.launchIn(scope)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment