Skip to content

Instantly share code, notes, and snippets.

@CharGrnmn
Created November 10, 2019 14:57
Show Gist options
  • Select an option

  • Save CharGrnmn/94eb8b82e2d4bc60fe37c4daca88ff6d to your computer and use it in GitHub Desktop.

Select an option

Save CharGrnmn/94eb8b82e2d4bc60fe37c4daca88ff6d to your computer and use it in GitHub Desktop.
Pokemon map example
@Effect()
loadAllBlogPosts$: Observable<any> = this.actions$.pipe(
ofType(PokemonActions.loadPokemon),
mergeMap(() =>
this.postsService.getAll().pipe(
map(posts => PokemonActions.loadPokemonSuccess({ posts })),
catchError(message => of(PokemonActions.loadPostsFailed({ message })))
)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment