How to cast jQuery $.ajax calls to Bluebird promises without the deferred anit-pattern
问题 Right now I use promise.deferred in a core file. This allows me to resolve promises at a central location. I've been reading that I may be using an anti-pattern and I want to understand why it is bad. so in my core.js file I have functions like this: var getMyLocation = function(location) { var promiseResolver = Promise.defer(); $.get('some/rest/api/' + location) .then(function(reponse) { promiseResolver.resolve(response); )} .catch(function(error) { promiseResolver.reject(error); }); return