General topic questions
RepeatOnLifecycle
MediumCommon
Free section · general topics & algorithms
Why collect flows with repeatOnLifecycle?
Reveal model answer
Stops collection when UI not STARTED/RESUMED, preventing leaks and wasted work. Preferred over lifecycleScope.launchWhenStarted patterns.