Created
March 10, 2019 09:31
-
-
Save jack-guy/4a6ab821c4068204f71428cf28b54662 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 { from, fromPromise } from 'rxjs'; | |
const iceCreamIds = [4, 5, 10, 12]; | |
from(iceCreamIds).pipe( | |
flatMap((iceCreamId) => fromPromise(getIceCreamById(iceCreamId))) | |
).subscribe((iceCream) => { | |
console.log(iceCream); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment