| Total Complexity | 2 |
| Complexity/F | 1 |
| Lines of Code | 21 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import axios from 'axios' |
||
| 2 | import {createAction} from 'redux-actions'
|
||
| 3 | |||
| 4 | export const GITHUB_FETCHING = 'modules/Github/FETCHING' |
||
| 5 | export const GITHUB_SUCCESS = 'modules/Github/SUCCESS' |
||
| 6 | export const GITHUB_ERROR = 'modules/Github/ERROR' |
||
| 7 | |||
| 8 | const githubFetching = createAction(GITHUB_FETCHING) |
||
| 9 | const githubError = createAction(GITHUB_ERROR) |
||
| 10 | const githubSuccess = createAction(GITHUB_SUCCESS) |
||
| 11 | |||
| 12 | export const getUserFromGithub = username => ({
|
||
| 13 | type : [ |
||
| 14 | githubFetching, |
||
| 15 | githubSuccess, |
||
| 16 | githubError |
||
| 17 | ], |
||
| 18 | payload : {
|
||
| 19 | data : () => axios.get('https://api.github.com/users/' + username)
|
||
| 20 | } |
||
| 21 | }) |
||
| 22 |