Skip to content

Instantly share code, notes, and snippets.

@jack-guy
Created March 10, 2019 09:31
Show Gist options
  • Save jack-guy/4a6ab821c4068204f71428cf28b54662 to your computer and use it in GitHub Desktop.
Save jack-guy/4a6ab821c4068204f71428cf28b54662 to your computer and use it in GitHub Desktop.
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