Created
August 3, 2017 18:13
-
-
Save larsw/85bab4f99fed8452187ccc09dde56495 to your computer and use it in GitHub Desktop.
rxjs groupBy() / flatMap() / group.reduce() problem
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
// | |
// yields a stream of objects. | |
// | |
observable.subscribe(x => console.log(x)) | |
// | |
// returns: | |
// [] | |
// [] | |
// [] | |
// ... | |
// [] | |
observable.groupBy(x => x.navntype) | |
.flatMap(group => group.reduce((acc, curr) => [...acc, ...curr], [])) | |
.subscribe(x => console.log(x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
all the objects in the observable has the 'navnetype' property.