Created
November 1, 2018 19:15
-
-
Save felixchez/553c43135f6701d71cc9cce5c820848f to your computer and use it in GitHub Desktop.
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
val dataTypeA = arrayListOf(1, 2, 3) | |
Observable.fromIterable(dataTypeA) | |
.map {element -> when (element) { | |
1 -> "one" | |
2 -> "two" | |
3 -> "three" | |
else -> "" | |
}} | |
.toList().toObservable() | |
// The result will be | |
// dataTypeB = arrayListOf<String>("one", "two", "three") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment