Created
June 29, 2019 21:00
-
-
Save psteiger/20e3371f8d8ab39a10fd58cb05413a97 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
inline fun <X, Y> LiveData<Resource<X>>.mapLiveDataResource( | |
crossinline transform: (X) -> Y | |
): LiveData<Resource<Y>> = | |
map { it.mapResource(transform) } | |
// map from androidx.lifecycle:lifecycle-livedata-ktx | |
// Equivalent to Transformations.map(source, func) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment