deferred-as-promise
2.0.0 • Public • Published deferred-as-promise
Wrap a deferred as a native Promise
.
Installation
Install using npm:
$ npm install deferred-as-promise
Usage
var $ = require('jquery');
var deferredAsPromise = require('deferred-as-promise');
deferredAsPromise($.ajax({
url: 'https://randomuser.me/api/',
dataType: 'json'
})).then(function(result) {
console.log(result);
}).catch(function(err) {
console.error(err);
});
Changelog
2.0.0
- Resolve/reject an array when deferred is resolved/rejected with multiple values
1.0.0
License
MIT
Package Sidebar
Install
npm i deferred-as-promise
Weekly Downloads