Created
November 6, 2015 09:26
-
-
Save WonderCsabo/132c1340aac48a70a436 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
Observable.from(parents) | |
.flatMap(Observable::from) | |
.map(parent -> parent.children) | |
.flatMap(Observable::from) | |
.filter(c -> c.index % 2 == 0) | |
.groupBy(child -> child.parent) | |
.flatMap(Observable::toList) | |
.map(children -> { | |
Listing child = children.get(0); // i know there is at least one | |
child.parent.children = children; | |
return child.parent; | |
}) | |
.subscribe(...) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment