Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Last active February 18, 2020 02:31
Show Gist options
  • Save alexytiger/db3fecc233be9ed393c43cf497b7cd04 to your computer and use it in GitHub Desktop.
Save alexytiger/db3fecc233be9ed393c43cf497b7cd04 to your computer and use it in GitHub Desktop.
e-book
loadProducts$ = createEffect(() =>
this.actions$.pipe(
ofType(PurchaseContractActions.loadProducts),
switchMap(() =>
this.fleaSrv.getPurchaseContractList().pipe(
tap(products =>
console.log('purchase contracts:', products)),
map(products =>
PurchaseContractActions.loadProductsSuccess({ products })),
catchError((err: Error) =>
of(this.handleError(err), SpinnerActions.hide()))
)
)
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment