Created
November 25, 2017 14:17
-
-
Save rarmatei/24c910d804175138fafd6c8aa6c01a88 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class MyService3 { | |
constructor() { | |
this._producer = Rx.Observable.of(1) | |
.publish(); | |
} | |
private _producer: Rx.ConnectableObservable<number>; | |
startItUp(): Rx.Observable<number> { | |
return Rx.Observable.create(obs => { | |
const subs = this._producer.subscribe(obs); | |
this._producer.connect(); | |
return subs; | |
}); | |
} | |
get passiveValues(): Rx.Observable<string> { | |
return this._producer.mapTo("got value"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment