Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | import getResume from './services'; export function resumeHasErrored(bool) { return { type: 'RESUME_HAS_ERRORED', hasErrored: bool, }; } export function resumeIsLoading(bool) { return { type: 'RESUME_IS_LOADING', isLoading: bool, }; } export function resumeFetchDataSuccess(resumeEntries) { return { type: 'RESUME_FETCH_DATA_SUCCESS', payload: resumeEntries, }; } export function resumeFetchData() { return async (dispatch) => { dispatch(resumeIsLoading(true)); try { const items = await getResume(); dispatch(resumeIsLoading(false)); dispatch(resumeFetchDataSuccess(items)); } catch (e) { dispatch(resumeHasErrored(true)); } }; } |