Skip to content

Instantly share code, notes, and snippets.

@rarmatei
Created November 25, 2017 14:09
Show Gist options
  • Save rarmatei/33b377906d9831f40c7d3314293aebcc to your computer and use it in GitHub Desktop.
Save rarmatei/33b377906d9831f40c7d3314293aebcc to your computer and use it in GitHub Desktop.
class MyService {
constructor() {
this._producer = Rx.Observable.of(1)
.publish();
}
private _producer: Rx.ConnectableObservable<number>;
startItUp(): Rx.Observable<number> {
this._producer.connect();
return this._producer;
}
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