如何在http请求之前添加操作?我想在请求之前运行TEST_INC ...,然后在http请求之后运行TEST_DEC
@Effect()
acadDomain$: Observable<Action> = this.actions$.pipe(
ofType('INIT_ACADEMY_DOMAIN'),
// I want here to apply action "TEST_INC"
mergeMap((action: any) =>
this.http.get('https://DOMAIN/settings.json').pipe(
switchMap((data) => [
{ type: 'INIT_ACADEMY', payload: data },
{ type: 'TEST_DEC' }
])
)
)
);
仅供参考:(rxjs 6)