2016-10-21 05:07:52 +00:00
|
|
|
'use strict';
|
2019-03-17 12:21:07 +00:00
|
|
|
|
|
|
|
const pDefer = () => {
|
2019-03-17 12:24:05 +00:00
|
|
|
const deferred = {};
|
2016-10-21 05:07:52 +00:00
|
|
|
|
2019-03-17 12:24:05 +00:00
|
|
|
deferred.promise = new Promise((resolve, reject) => {
|
|
|
|
deferred.resolve = resolve;
|
|
|
|
deferred.reject = reject;
|
2016-10-21 05:07:52 +00:00
|
|
|
});
|
|
|
|
|
2019-03-17 12:24:05 +00:00
|
|
|
return deferred;
|
2016-10-21 05:07:52 +00:00
|
|
|
};
|
2019-03-17 12:21:07 +00:00
|
|
|
|
|
|
|
module.exports = pDefer;
|
2019-04-03 05:19:13 +00:00
|
|
|
// TODO: Remove this for the next major release
|
2019-03-17 12:21:07 +00:00
|
|
|
module.exports.default = pDefer;
|