Lukas Lechner
07/28/2022, 10:10 AMSharedFlow
and performs network request every minute while there are active subscribers and emits the result. I don't want to perform network requests when the app is in the background.
Should it be the responsibility of the datasource to stop performing network requests when the app goes into background, or should it be the responsibility of the clients of the data source to cancel their coroutines that collect from the datasource?
If it's the responsibility of the clients, then one faulty client implementation can make the datasource to stay active ....Adam Powell
07/28/2022, 2:51 PMLifecycle[Owner].repeatOnLifecycle
is a helpful tool for this in cases that have a LifecycleOwner
available