deferred-as-promise
v2.0.0
Published
Wrap a deferred as a native Promise
Downloads
2
Readme
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
- Initial release
License
MIT