Created
December 18, 2017 23:27
-
-
Save Christopher2K/b31b9ea841fbba91c8a7c2512ed1791e to your computer and use it in GitHub Desktop.
Create an observable
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
function myDataStream(observer) { | |
observer.next('Hello'); | |
observer.next('Reactive'); | |
observer.next('World'); | |
} | |
const obsOne = Rx.Observable.create(myDataStream); | |
const subscriptionOne = obsOne.subscribe((data) => { | |
console.log(`Output Obs 1 : ${data}`); | |
}); | |
/** | |
* Print: | |
* Output Obs 1 : Hello | |
* Output Obs 1 : Reactive | |
* Output Obs 1 : World | |
* / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment