prudhvi reddy
03/19/2024, 6:17 PMcollectAsState
and collectAsStateWithLifecycle
is taking in a param context
Should i be passing
viewLifecycleOwner.lifecycleScope.coroutineContext,
val state by viewModel.orderDetailsLiveData.asFlow().collectAsState(
initial = null,
context = viewLifecycleOwner.lifecycleScope.coroutineContext,
)
To collect the state properly when i'm using fragments + compose ?
When should someone be using context
param ?Ian Lake
03/19/2024, 6:37 PMprudhvi reddy
03/19/2024, 6:51 PMMichael Krussel
03/19/2024, 8:43 PMprudhvi reddy
03/20/2024, 7:41 AM