Created
February 25, 2018 21:17
-
-
Save MikeRyanDev/2ae1ec77758992fabb68fd6d3b40d5d4 to your computer and use it in GitHub Desktop.
This file contains 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
export class BookEffects { | |
@Effect() getOneBook$ = this.action$.pipe( | |
ofType(INPUT_ACTION_TYPE), | |
groupBy( | |
action => action.bookId, | |
action => action.bookId, | |
bookId$ => bookId$.pipe( | |
timeoutWith(15000, Observable.empty(), | |
ignoreElements(), | |
), | |
), | |
map(bookId$ => bookId$.pipe( | |
exhaustMap(bookId => this.bookService.getOne(bookId)), | |
)), | |
mergeAll(), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment