You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

51 lines
747 B

/*!
* Module dependencies.
*/
var MPromise = require('./promise');
/**
* Helper for multiplexing promise implementations
*
* @api private
*/
var Promise = {
_promise: MPromise
};
/**
* Get the current promise constructor
*
* @api private
*/
Promise.get = function() {
return Promise._promise;
};
/**
* Set the current promise constructor
*
* @api private
*/
Promise.set = function(lib) {
if (lib === MPromise) {
return Promise.reset();
}
Promise._promise = require('./ES6Promise');
Promise._promise.use(lib);
require('mquery').Promise = Promise._promise.ES6;
};
/**
* Resets to using mpromise
*
* @api private
*/
Promise.reset = function() {
Promise._promise = MPromise;
};
module.exports = Promise;