0
我有很多Reducer查詢,我需要鏈接到行爲主題。目前我正在爲此做好每一件!@ngrx - 將商店查詢鏈接到BehaviorSubject
有沒有更簡潔的方式來表達這一點?
this._higherCurveObservable = this.store.let(getCurveSummaryForInstrumentTimeframe(this._instrument, this._timeframe.Code));
this._higherCurveSubject = <BehaviorSubject<CurveSummary>>new BehaviorSubject(null).distinctUntilChanged();
this._higherCurveSubscription = this._higherCurveObservable.subscribe(x => this._higherCurveSubject.next(x));
this._higherCurveSubject.subscribe(x => this.higherCurveChange(x));
非常有幫助!謝謝!你說得對,我濫用行爲主題。我現在有一個單一的中央數據存儲區,它的工作非常漂亮! – reach4thelasers