I am using redux. I want to perform a certain network call after updating store. I wrote promise for this as -
let promise=new Promise(function(resolve,reject){
updateStore() //separate method which updates the store.
}).then(()=>{
//Netowrk call
//axios code
});
I am getting a syntax error here : Declaration or statement expected.
What should be the way of performing this activity?
asyncfunction, you can useawait, which will do the Promise magic, but without the additional syntax. Note thatasync/awaitisn't compatible with some older browsers.