We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
launchWhenResumed is not recommended and will be removed in the future. We should instead use repeatOnLifecycle
launchWhenResumed
repeatOnLifecycle
Exemple:
lifecycleScope.launch { lifecycle.repeatOnLifecycle(Lifecycle.State.RESUMED) { flow.collect { flowItem -> //DoSomethingWithFlowItem(flowItem } } }
We might also be safer with listening viewEvents flow from ViewModel, to avoid refreshing UI if the app is in background: So replace:
viewEvents
viewEvents .stream() .onEach { hideWaitingView() observer(it) } .launchIn(lifecycleScope)
By:
lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.RESUMED){ viewEvents.stream() .collect { hideWaitingView() observer(it) } } }
The text was updated successfully, but these errors were encountered:
bmarty
Successfully merging a pull request may close this issue.
launchWhenResumed
is not recommended and will be removed in the future.We should instead use
repeatOnLifecycle
Exemple:
We might also be safer with listening
viewEvents
flow from ViewModel, to avoid refreshing UI if the app is in background:So replace:
By:
The text was updated successfully, but these errors were encountered: