Created
April 24, 2019 07:05
-
-
Save Mayankgupta688/fd8e5d1bf3fab2df838699f2eca8b858 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
import { Observable } from 'rxjs'; | |
var randomNumberGenerator = Observable.create(function(observer) { | |
observer.next(Math.floor(Math.random() * 100)); | |
observer.next(Math.floor(Math.random() * 100)); | |
observer.next(Math.floor(Math.random() * 100)); | |
observer.next(Math.floor(Math.random() * 100)); | |
observer.next(Math.floor(Math.random() * 100)); | |
observer.next(Math.floor(Math.random() * 100)); | |
observer.next(Math.floor(Math.random() * 100)); | |
}); | |
randomNumberGenerator.subscribe(function(value) { | |
console.log("Value from the Simple Observable: " + value); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment