import { Observable, Observer, Subject } from '@reactivex/rxjs'; export class WitcaseObservable { protected observable: Observable; protected subject: Subject; constructor(){ this.subject = new Subject(); this.observable = new Observable().multicast(this.subject); } protected subscribe(observer: (t: T) => void){ this.observable.subscribe(observer); } protected publish(value?: T){ this.subject.next(value); } }