Created
August 25, 2019 14:10
-
-
Save SeongUgJung/6821b1ed88ced81f93bd0932b4e60d6a 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
class GoogleMapProvider: MapProvider { | |
private val mapCache: BehaviorSubject<Map> = BehaviorSubject.createDefault(DEFAULT) | |
override fun initMap(): Observable<Map> { | |
return Observable.create(this::addMapFragment) | |
.switchMapSingle(this::waitingForLoading) | |
.doOnNext(mapCache::onNext) | |
} | |
override fun getMap(): Observable<Map> = mapCache.hide() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment