I have a promise structured as follows:
let promise = new Promise((resolve, reject) => {
axios.post("https://httpbin.org/post", params, header)
.then(response => {
resolve(Object.assign({}, response.data));
// resolve("aaaa");
console.log(response);
})
.catch(error => reject(error))
});
What is the significance of resolving this promise with response data?
If I were to replace
resolve(Object.assign({}, response.data));
with resolve("aaaa");
, what would be the outcome?
Any assistance or clarification on this matter would be greatly appreciated. Thank you.