I have a problem with coping simple flow in Jetpack Compose. The scenario is simple:
- call
Composablewhich draws screen and in its body callviewHolder's fetch method. viewHolder's fetch method first postisLoading.postValue(true)Composableshows loading animationviewHoldercalls repository to fetch data and- when receives it, sets
isLoading.postValue(false)and posts fetched data Composableshows fetched data
My problem is with constant reloading composable and calls to viewHolder's calls to fetch data. How can I prevent that?