Last active
February 19, 2020 00:39
-
-
Save alexytiger/9b88f2c81dc212a555dbc7d604ab37ac to your computer and use it in GitHub Desktop.
e-book
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
downloadImage$ = createEffect( | |
() => | |
this.actions$.pipe( | |
ofType(IpfsImageActions.downloadImage), | |
map((action) => action.ipfsHash), | |
switchMap((ipfsHash: string) => | |
this.ipfsSrv.getFile(ipfsHash).pipe( | |
map((image: Blob) => | |
IpfsImageActions.downloadImageSuccess({ image })), | |
catchError((err: Error) => | |
of(this.handleError(err), IpfsImageActions.downloadImageError()) | |
) | |
) | |
) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment