Created
April 23, 2020 18:28
-
-
Save NyaGarcia/08b2a1f37a4e20c3fa1a3029b542cd60 to your computer and use it in GitHub Desktop.
Subscribing to Observables created with from()
This file contains hidden or 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
letter$.subscribe(letter => console.log(letter)); | |
// Output: "R","x","J","S"," ","i","s"," ","c","o","o","l" | |
fruit$.subscribe(console.log); | |
// Output: "Strawberry", "Cherry", "Blackberry" | |
pokemon$.subscribe(console.log); | |
// Output: ["Squirtle", "Water"], ["Charmander", "Fire"], ["Bulbasur", "Grass"] | |
promise$.subscribe(promise => console.log(promise)); | |
// Output "I promise to start learning RxJS" | |
node$.subscribe(node => console.log(node)); | |
// Output: HTMLParagraphElement {tagName: "p", attributes: {...}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment