Created
February 25, 2018 21:15
-
-
Save MikeRyanDev/f3715241d86e38b1f196e10a374bddbc to your computer and use it in GitHub Desktop.
Revisions
-
MikeRyanDev created this gist
Feb 25, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ export class BookEffects { @Effect() getOneBook$ = this.actions$.pipe( // Step 1 Type: Observable<InputActionType> ofType(INPUT_ACTION_TYPE), // Step 2 Type: Observable<Observable<InputActionType>> groupBy(action => action.bookId), // Step 3 Type: Observable<Observable<BookModel>>, map(action$ => action$.pipe( exhaustMap(action => this.bookService.getOne(action.bookId), )), // Step 4 Type: Observable<BookModel> mergeAll(), ); }