Last active
April 23, 2020 18:53
-
-
Save NyaGarcia/cb2b4ccb196da66c4021376373bc1c9e to your computer and use it in GitHub Desktop.
Comparation of Observables created with from() and 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
const fruitsOf$ = of(["Strawberry", "Cherry"], ["Lemon", "Orange"]); | |
const fruitsFrom$ = from(["Strawberry", "Cherry", "Blackberry"]); | |
fruitOf$.subscribe(fruit => console.log(fruit)); | |
// Output: ["Strawberry", "Cherry"] ["Lemon", "Cherry"] | |
fruitFrom$.subscribe(console.log); | |
// Output: "Strawberry", "Cherry", "Blackberry" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment