Last active
February 25, 2018 21:40
-
-
Save MikeRyanDev/9f1643381c7ad16fc208378dbf258fbf 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() updateBook$ = this.actions$.pipe( | |
ofType(INPUT_ACTION_TYPE), | |
groupBy( | |
action => action.bookId, | |
action => action, | |
action$ => action$.pipe( | |
timeoutWith(15000, Observable.empty()), | |
ignoreElements(), | |
), | |
), | |
map(action$ => action$.pipe( | |
concatMap(action => this.bookService.updateOne( | |
action.bookId, | |
action.bookUpdates, | |
)), | |
), | |
mergeAll(), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment