Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Last active September 15, 2019 16:59
Show Gist options
  • Save alexytiger/cca8285e59d5723573c7d42b0280860c to your computer and use it in GitHub Desktop.
Save alexytiger/cca8285e59d5723573c7d42b0280860c to your computer and use it in GitHub Desktop.
loadPurchaseContract$ = createEffect(
() =>
this.actions$.pipe(
ofType(PurchaseContractActions.loadPurchaseContract),
map(action => action.address),
switchMap(address => {
return this.purchaseSrv.loadPurchaseContract(address).pipe(
map(contract =>
PurchaseContractActions.loadPurchaseContractSuccess({ contract })),
catchError((err: Error) =>
of(ErrorActions.errorMessage({ errorMsg: err.message }), SpinnerActions.hide())
))
})
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment