Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Last active February 19, 2020 00:24
Show Gist options
  • Save alexytiger/f377b59e0f575086e95f341cc6afb9dd to your computer and use it in GitHub Desktop.
Save alexytiger/f377b59e0f575086e95f341cc6afb9dd to your computer and use it in GitHub Desktop.
e-book
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(this.handleError(err), SpinnerActions.hide()))
);
})
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment