Skip to content

Instantly share code, notes, and snippets.

@manuelvicnt
Created May 3, 2021 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manuelvicnt/c08046c8ddf29157a981df254c2862c1 to your computer and use it in GitHub Desktop.
Save manuelvicnt/c08046c8ddf29157a981df254c2862c1 to your computer and use it in GitHub Desktop.
class LocationRepository(
private val locationDataSource: LocationDataSource,
private val externalScope: CoroutineScope
) {
val locations: Flow<Location> =
locationDataSource.locationsSource
.shareIn(externalScope, SharingStarted.Eagerly, replay = 10)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment