dm
Version:
Dependency Injection Manager
41 lines (34 loc) • 852 B
JavaScript
var Async = require("../async"),
_ = require("../utils"),
RSVPAsync;
/**
* RSVPAsync
*
* @class RSVPAsync
* @extends Async
* @author Sergey Kamardin <s.kamardin@tcsbank.ru>
*/
RSVPAsync = Async.extend(
/**
* @lends RSVPAsync.prototype
*/
{
constructor: function() {
Async.prototype.constructor.apply(this, arguments);
this.RSVP = this.adaptee;
},
promise: function(resolver) {
return new this.RSVP.Promise(resolver);
},
all: function(promises) {
return this.RSVP.all(promises);
},
resolve: function(value) {
return this.RSVP.Promise.resolve(value);
},
reject: function(error) {
return this.RSVP.Promise.reject(error);
}
}
);
module.exports = RSVPAsync;