Dilraj Singh
Apr 19, 2022

Great way to tackle such use-cases, however, I have one doubt. In this (https://gist.github.com/StephenVinouze/c0f771df5ebf4023b36c822a7836c6ff#file-composable_disposable_effect_view-kt), you are calling the ViewModel function once the lifecycle reaches the resumed state. But this `if `statement will also be called if any recomposition occurs, which in turn will call the ViewModel function which might not be the desired result. I think it should be in some kind of effect, and it can be re-structured using snapshotFlow as follows-

https://gist.github.com/dilrajsingh1997/8e736b2e1532aca6480c587c45f70255

Dilraj Singh
Dilraj Singh

Responses (1)