【发布时间】:2018-12-27 03:15:05
【问题描述】:
@Effect()
initDomain$: Observable<Action> = this.actions$.pipe(
ofType('INIT_DOMAIN'),
mergeMap((action: any) =>
this.http.get('https://demo.api/url1.php').pipe(
switchMap((data) => [
{type: 'INIT_IT', payload: data}
]),
catchError(() => of({type: 'INIT_IT_FAILED'}))
)
)
);
我有这种角度效果 (ngrx),它会在继续之前发出 1 个请求。如何在继续之前发出 2 个请求并等待两个响应?我知道 forkJoin() 是答案,但我对语法有点困惑
【问题讨论】:
标签: rxjs ngrx ngrx-effects fork-join rxjs6