Created
July 20, 2019 13:02
-
-
Save alexytiger/4987cb5efe89ae4b4a03e6b4ac45bdce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| addProduct$ = createEffect(() => | |
| this.actions$.pipe( | |
| ofType(PurchaseContractActions.createPurchaseContractSuccess), | |
| switchMap((payload) => { | |
| return this.productSrv.loadPurchaseContract(payload.address).pipe( | |
| tap(product => console.log('purchase contract:', product)), | |
| map(product => PurchaseContractActions.addProduct({product})), | |
| catchError((err: Error) => | |
| of(ErrorActions.errorMessage({ errorMsg: err.message })) | |
| ) | |
| ); | |
| }) | |
| ) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment