Created
August 6, 2019 16:18
-
-
Save SeongUgJung/7b43158854d4d98a65a4442b7fcd00de 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
// 기존 | |
RxLifecycle().apply { init = Observable.create().subscribe() } | |
// 코드 추가 | |
fun onInit(disposableFunction: () -> disposable): RxLifecycle | |
class RxLifecycle : LifecycleObserver { | |
fun init(init: DisposableFunction): RxLifecycle { | |
this.onInit = init | |
return this | |
} | |
} | |
// 변경 후 | |
onInit { Observable.create().subscribe() } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment