Last active
July 11, 2021 12:16
-
-
Save qmzik/fbfadebb74f85bf5200f48a326f8658c 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'; | |
const source = new Observable<number>((subscriber) => { | |
subscriber.next(1); | |
subscriber.next(2); | |
subscriber.next(3); | |
subscriber.complete(); | |
}); | |
// Usage | |
console.log('start'); | |
source.subscribe({ | |
next: console.log, | |
complete: () => console.log('done'), | |
}); | |
console.log('stop'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment