Skip to content

Instantly share code, notes, and snippets.

@alex3165
Last active October 12, 2016 08:51
Show Gist options
  • Save alex3165/8c03d2875d400318b82052b094edf041 to your computer and use it in GitHub Desktop.
Save alex3165/8c03d2875d400318b82052b094edf041 to your computer and use it in GitHub Desktop.
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