deferred-as-promise

2.0.0 • Public • Published

deferred-as-promise

Wrap a deferred as a native Promise.

npm Version Build Status Test Coverage Dependency Status

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

Readme

Keywords

Package Sidebar

Install

npm i deferred-as-promise

Weekly Downloads

0

Version

2.0.0

License

MIT

Last publish

Collaborators

  • jimf