I'm new to RxJs and angular and was wondering if there's a way to make the following code simpler while retaining its functionality. Is there room for improvement or is this as good as it gets?
private configureDataStreams() {
let params$ = this.params$.pipe(debounceTime(300));
this.user$
.pipe(
mergeMap(user =>
from(this.loadPosts(user)).pipe(map(posts => ({ user, posts })))
),
combineLatest(this.dates$, params$),
switchMap(({user, posts}, dates, params) =>
from(
this.loadData(dates.date, dates.endDate, user, posts, params)
).pipe(map(data => ({ dates, data })))
)
)
.subscribe(({ dates, data }) => this.displayFetchedData(data, dates));
this.paramsSubject.next(this.params);
}