Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Last active September 16, 2019 23:25
Show Gist options
  • Save alexytiger/5738922cfbff252003ef4dcb489f2360 to your computer and use it in GitHub Desktop.
Save alexytiger/5738922cfbff252003ef4dcb489f2360 to your computer and use it in GitHub Desktop.
this.selectedPurchaseContract$ = this.store$.pipe(
select(fromStore.getSelectedProduct),
filter(product => !!product),
tap(product => this.store$.dispatch(PurchaseContractActions.loadPurchaseContract({ address: product.contractAddress }))),
// we switch from one observable to another
switchMap(() => this.store$.select(fromStore.getSelectedPurchaseContract)),
filter(contract => !!contract),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment