Last active
January 15, 2019 13:18
-
-
Save shangyilim/cb60daa0b22287229d6e0468ab1a288f 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
import { combineLatest } from 'rxjs'; | |
var californiaOrColorado$ = combineLatest(california$, colorado$) | |
.pipe( | |
map((cities) => { | |
// Destructure the values to combine a single array. | |
var [californiaCities, coloradoCities] = cities; | |
return [ | |
//spread the arrays out to combine as one array | |
...californiaCities, | |
...coloradoCities | |
]; | |
})); | |
californiaOrColorado$.subscribe(cities => console.log(cities)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment