Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Last active February 19, 2020 00:58
Show Gist options
  • Save alexytiger/05d2dd382d2695e4e973013c9b27712e to your computer and use it in GitHub Desktop.
Save alexytiger/05d2dd382d2695e4e973013c9b27712e to your computer and use it in GitHub Desktop.
e-book
reload$ = createEffect(
() =>
this.actions$.pipe(
ofType(
PurchaseContractActions.abortSelectedPurchaseContractSuccess,
PurchaseContractActions.confirmBuySuccess,
PurchaseContractActions.confirmDeliverySuccess,
PurchaseContractActions.releaseEscrowSuccess,
PurchaseContractActions.withdrawByOwnerSuccess),
withLatestFrom(
this.store$.pipe(select(fromStore.getSelectedPurchaseContract))),
tap(async ([action, contract]) => {
// we need to reload on the same route
// based on https://github.com/angular/angular/issues/13831
this.router.routeReuseStrategy.shouldReuseRoute = ( ) => false;
this.router.navigate(['/market-place/products', contract.productKey]);
})
),
{ dispatch: false }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment