Last active
October 12, 2016 08:51
-
-
Save alex3165/8c03d2875d400318b82052b094edf041 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
const oauthUserEpic = (action$) => { | |
let horribleSideEffect; | |
return action$ | |
.ofType(OAUTH_USER) | |
.concatMap(({ token }) => { | |
horribleSideEffect = token; | |
return get({ | |
endpoint: 'user', | |
params: { access_token: token } | |
}); | |
}) | |
.map((user) => | |
addUser( | |
user.set('access_token', horribleSideEffect) | |
) | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment