Open jiqimaogou opened 7 years ago
I am not sure if this help, but in my app I am using it as follows with "redux-thunk": "~2.2.0"
"redux-thunk": "~2.2.0"
import { get as apiGet, patch as apiPatch, } from '../utils/api' export function APIfindProfileInfo() { return function(dispatch, getState) { dispatch(loadProfileStart()) return apiGet('https://yourdomain/accounts?id=1', false) .then(data => { if (!data || !data.account_profile) { dispatch(loadAccountProfileFailure(new Error('no account profile returned'))) return } dispatch(loadAccountProfileSuccess(data)) }) .catch(err => dispatch(loadAccountProfileFailure(err)) ) } }
I am not sure if this help, but in my app I am using it as follows with
"redux-thunk": "~2.2.0"