Consuming the flows safely in Compose - devrath/KotlinAlchemy GitHub Wiki
Introduction
- Collecting the flows in a lifecycle-aware manner is the recommended way to consume the flows if you are using the jetpack compose.
- We can use the
collectAsStateWithLifecycle
API to achieve this.
Background
- The
collectAsStateWithLifecycle
API can help conserve the app resources
- Say your application is in the background, Here the flow does not need to be active. If it is active it may impact the device's health.
- The queries include
data-base connections
, firebase queries
, network-connections
etc.
Visulization
