Skip to content

Commit

Permalink
Provide explicit visibility for klocation compose module
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedol committed Aug 14, 2024
1 parent 74278c3 commit ec14ec4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import com.addhen.klocation.LocationState
import kotlinx.coroutines.flow.distinctUntilChanged

@Composable
fun locationUpdatesState(locationService: LocationService): State<LocationState> {
public fun locationUpdatesState(locationService: LocationService): State<LocationState> {
return locationService
.requestLocationUpdates()
.distinctUntilChanged()
.collectAsState(LocationState.CurrentLocation(null))
}

@Composable
fun lastKnowLocationState(locationService: LocationService): State<LocationState> {
public fun lastKnowLocationState(locationService: LocationService): State<LocationState> {
return produceState(LocationState.CurrentLocation(null)) {
locationService.getLastKnownLocation()
}
Expand Down

0 comments on commit ec14ec4

Please sign in to comment.