Skip to content

Instantly share code, notes, and snippets.

@ackuser
Forked from praveenpuglia/multiple-actions.ts
Created January 16, 2020 12:35
Show Gist options
  • Save ackuser/e1e726434de724cf7b09169c058d4b41 to your computer and use it in GitHub Desktop.
Save ackuser/e1e726434de724cf7b09169c058d4b41 to your computer and use it in GitHub Desktop.
Dispatch multiple actions from ngrx effect
@Effect()
search$: Observable<Action> = this.actions$.pipe(
ofType(SearchActions.SEARCH),
switchMap(action => {
const query = action.payload;
return [new FetchPanel1Data(query), new FetchPanel2Data(query)];
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment