How to Avoid It
Simply return the existing promise without wrapping
Example:
function getStuffDone(param) {
return myPromiseFn(param + 1);
}
If additional logic is neede
function getStuffDone(param) {
return myPromiseFn(param + 1)
.then((val) => {
return val;
});
}
Avoid creating a new Promise or deferred object unless absolutely necessary. Leverage chaining and existing promises instead.