Skip to content

Instantly share code, notes, and snippets.

@MikeRyanDev
Created February 25, 2018 21:17
Show Gist options
  • Save MikeRyanDev/2ae1ec77758992fabb68fd6d3b40d5d4 to your computer and use it in GitHub Desktop.
Save MikeRyanDev/2ae1ec77758992fabb68fd6d3b40d5d4 to your computer and use it in GitHub Desktop.
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