Last active
June 12, 2019 11:00
-
-
Save panvourtsis/1cb5bc76bd7f4d95046f66fbc7b22334 to your computer and use it in GitHub Desktop.
This file contains 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
const fetchUserEpic = (action$: ActionsObservable<UserActionTypes>) => | |
action$.pipe( | |
ofType(FETCH_USER_REQUEST), | |
switchMap(() => | |
from(API.fetch()).pipe( | |
mergeMap(data => of(setUserInfo(data))), | |
catchError(() => of(unsetUserInfo())) | |
) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment