【发布时间】:2018-08-19 22:22:09
【问题描述】:
我有一个效果,但是它里面的第一个 switchMap 之后的 mergeMap 被触发而没有触发 GetPackageCalendar 类型的动作
@Effect()
loadCalendar$ = this.actions$
.pipe(
ofType(fromActions.GetPackageCalendar),
switchMap(() => this.store.select(selectRouterState)),
mergeMap(
(state: RouterStateUrl) => this.store.select(selectCalendarParams).pipe(
switchMap((calParams) => this.getPackageCalendar(state, calParams)),
//this gets executed
),
),
map((calendar: CalendarRS) => new fromActions.SetPackageCalendar(calendar)),
);
`
发生了什么?
我想从存储中选择两个值并将它们作为参数传递给getPackageCalendar
【问题讨论】: