Dispatch multiple actions from effects: difference between different rxjs operators
问题 I need to dispatch multiple actions from an ngrx effect once an http request is successful. There are several ways that seem to work and some that don't, I can't understand what the difference is. @Effect() loadUser = this.actions .pipe( ofType(campaignActions.type.LOAD_CAMPAIGN), map((action: userActions.LoadUserAction) => action.payload), switchMap((payload: { id: number }) => this.s.getUser(payload.id) .pipe( switchMap((data) => { return from([ new userActions.LoadUserSuccessAction(), new