Created
November 10, 2019 05:54
-
-
Save vinhlee95/1774d5875342f09b6b68096f3014c36b 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} from 'rxjs/operators' | |
const fetchCakesPromise = fetch(getCakesEndpoint, {method: 'GET'}).then(res => res.data.cakes) | |
// Get cakes stream creation 🌈 | |
const cakeSource = from(fetchCakesPromise) | |
// Subscribe cake data and consume received cakes 🍽 | |
cakeSource.subscribe(console.log) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment