export const requestProfile: ThunkActionCreator<Promise<Linode.Profile>> = () => (dispatch) => { const { started, done, failed } = getProfileActions; dispatch(started()); return getProfile() .then(response => response.data) .then(maybeRequestGrants) .then((response) => { dispatch(done({ result: response })); return response; }) .catch((error) => { dispatch(failed({ error })); return error; }); };
> = () => dispatch => { const { started, done, failed } = getProfileActions; dispatch(started()); return getProfile() .then(response => response.data) .then(maybeRequestGrants) .then(response => { dispatch(done({ result: response })); return response; }) .catch(error => { dispatch(failed({ error })); return error; }); };