Skip to content

Instantly share code, notes, and snippets.

@thecodinganalyst
Created June 16, 2022 14:02
Show Gist options
  • Save thecodinganalyst/896ddc0922736cb582b813abe1de3fb4 to your computer and use it in GitHub Desktop.
Save thecodinganalyst/896ddc0922736cb582b813abe1de3fb4 to your computer and use it in GitHub Desktop.
Effect
loadBooks$ = createEffect(() => this.actions$.pipe(
ofType(BookStoreActions.loadBooks),
mergeMap(() => this.booksService.getBooks().pipe(
map(books => BookStoreActions.booksLoaded({books})),
catchError(() => EMPTY)
))
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment