-
-
Save sebastialonso/20b385d77f8d940667591af4e3c3bab0 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
import Request from 'superagent'; | |
export function getIssues() { | |
const request = Request | |
.get('http://issues.com/issues') | |
return (dispatch) => { | |
request.end((err, res) => { | |
if (res.ok) | |
dispatch({ | |
type: 'GET_ISSUES', | |
payload: res.body.issues | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment