So in my ngOnInit, I have the following
this._store.select(AuthorSegmentsState.getAuthorSegments).pipe(take(1)).subscribe(res => {
this.selectedSegment = res.selectedSegment;
if(!this.selectedSegment.segmentID) {
this._acm.getSpecificSegment(res.selectedSegment.segmentName).subscribe(segment => {
this.selectedSegment.segmentID = segment.data.segmentID;
})
}
});
I have heard a few times before that you should never have an observable nested inside another one though.
Is there a more elegant way that I can create this behavior?