Created
April 23, 2020 15:07
-
-
Save NyaGarcia/0f9ad96869f4a574aae87bd60c56ce4f to your computer and use it in GitHub Desktop.
Subscribing to Observables created with of()
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
number$.subscribe(number => console.log(number)); | |
// Output: 1 2 3 4 5 | |
pokemon$.subscribe(pokemon => console.log(pokemon)); | |
// Output: Squirtle Charmander Bulbasur | |
fruit$.subscribe(fruit => console.log(fruit)); | |
// Output: ["Strawberry", "Cherry"] ["Lemon", "Cherry"] | |
iceCream$.subscribe(iceCream => console.log(iceCream)); | |
// Output: { size: "Large", toppings: ["Oreos", "Chocolate syrup"] } { size: "small", toppings: ["Strawberries"] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment