AdiA
Reactiflux5y ago
1 reply
Adi

Adi – 18-39 Feb 8

I am trying to make API call after some delay with 3-5 secs but it fails everytime any idea why it is happening? Any suggestions for improvement?
async function foo(account_id, id, oauth_access_token) {
    return new Promise((resolve, reject) => {
        setTimeout(async () => {
            const result = await axios.post(`API`)
            resolve(result);
        }, 5000);
    });
}
Was this page helpful?