Created
March 29, 2018 07:11
-
-
Save YusukeIwaki/32a5491b4853b6af2b2aa2d4e5c78885 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
import android.arch.lifecycle.LiveData | |
import android.arch.lifecycle.Transformations | |
fun <X, Y> LiveData<X>.map(f: (X?) -> Y?): LiveData<Y> { | |
return Transformations.map(this, f) | |
} | |
fun <X, Y> LiveData<X>.switchMap(f: (X?) -> LiveData<Y>): LiveData<Y> { | |
return Transformations.switchMap(this, f) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment