-
Notifications
You must be signed in to change notification settings - Fork 22
Consuming the flows safely in Compose
Devrath edited this page May 4, 2024
·
3 revisions
- 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.
- 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.