Skip to content

Instantly share code, notes, and snippets.

@SeongUgJung
Last active August 25, 2019 14:11
Show Gist options
  • Save SeongUgJung/058b8fb94577285c91660dfd4d285585 to your computer and use it in GitHub Desktop.
Save SeongUgJung/058b8fb94577285c91660dfd4d285585 to your computer and use it in GitHub Desktop.
Single.create { emitter: SingleEmitter<Map> ->
mapFragment.getMapAsync { map: GoogleMap? ->
map?.let { actualMap ->
actualMap.setOnMapLoadedCallback {
emitter.onSuccess(GoogleMapImpl(actualMap))
}
} ?: run { emitter.tryOnError(IllegalStateException("No Map")) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment