Created
April 25, 2018 18:24
-
-
Save praveenpuglia/5867355739849cd1670b83f48b0d5a5a to your computer and use it in GitHub Desktop.
Dispatch multiple actions from ngrx effect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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