Skip to content

Instantly share code, notes, and snippets.

@lmatteis
Created December 2, 2016 14:08
Show Gist options
  • Save lmatteis/d99da5afe8a1284e2bd0324e1eb3bf99 to your computer and use it in GitHub Desktop.
Save lmatteis/d99da5afe8a1284e2bd0324e1eb3bf99 to your computer and use it in GitHub Desktop.
function main(sources) {
const request$ = sources.ACTION
.filter(action => action.type === ActionTypes.REQUESTED_USER_REPOS)
.map(action => action.payload.user)
.map(user => {
url: `https://api.github.com/users/${user}/repos`,
category: 'users'
})
const action$ = sources.HTTP
.select('users')
.flatten()
.map(receiveUserRepos.bind(null, user))
return {
ACTION: action$,
HTTP: request$
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment