Created
May 30, 2019 09:40
-
-
Save zinevych/816138d09349300b6557e12ab27529f0 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
// create observable | |
const exampleObservable$ = new Observable((observer) => { | |
// observable execution | |
observer.next('example value 1'); | |
observer.next('example value 2'); | |
observer.next('example value 3’); | |
observer.complete(); | |
}) | |
// subscribe | |
const observer = exampleObservable$.subscribe((item) => { | |
console.log(item); | |
}) | |
// unsubscribe the observer | |
observer.unsubscribe(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment