Last active
August 12, 2022 11:35
-
-
Save manuelvicnt/6629b53e33b97c127508227ed6e0bee4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Composable | |
| fun LocationUI(locationFlow: Flow<Location>) { | |
| val location by locationFlow.collectAsStateWithLifecycle() | |
| // Current location, do something with it | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
flowWithLifecycle returns a Flow right? then locationFlowLifecycleAware is a Flow , but a flow does not have an initial value as StateFlow has, so I'd say val location by locationFlowLifecycleAware.collectAsState() is incorrect since needs an initial value.