Is this the correct way to convert jQuery Deferred to a Promise?
var p = Promise.resolve($.getJSON(\'api/values\', null));
Are there any ot
I would prefer composition:
const successCb1 = ()=>$.getJSON('api/values'), successCb2 = (json)=>alert(json), errorCb = (e)=>alert(e); Promise .resolve() .then(successCb1) .then(successCb2) .catch(errorCb);