Last active
January 18, 2020 04:42
-
-
Save alexytiger/80de47a2a22b15c45021e55e7f135890 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