Created
July 24, 2018 06:27
-
-
Save gpeal/fcb2cd8ec42895c029b0ceb56e4f6a76 to your computer and use it in GitHub Desktop.
MvRxFragmentExtension
This file contains 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
fun <S : MvRxState> MvRxViewModel<S>.subscribe( | |
shouldUpdate: ((S, S) -> Boolean)? = null, | |
observerScheduler: Scheduler = AndroidSchedulers.mainThread(), | |
subscriber: ((S) -> Unit)? = null | |
) = subscribe(this@MvRxFragment, shouldUpdate, observerScheduler, subscriber ?: { if (readyToInvalidate()) invalidate() }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment