Skip to content

Instantly share code, notes, and snippets.

@MikeRyanDev
Last active February 25, 2018 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeRyanDev/9f1643381c7ad16fc208378dbf258fbf to your computer and use it in GitHub Desktop.
Save MikeRyanDev/9f1643381c7ad16fc208378dbf258fbf to your computer and use it in GitHub Desktop.
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