Quantumbraid's picture
download
raw
744 Bytes
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
// The source (has been changed) is https://github.com/facebook/react/issues/5465#issuecomment-157888325
var CANCELATION_MESSAGE = {
type: 'cancelation',
msg: 'operation is manually canceled'
};
function makeCancelable(promise) {
var hasCanceled_ = false;
var wrappedPromise = new Promise(function (resolve, reject) {
promise.then(function (val) {
return hasCanceled_ ? reject(CANCELATION_MESSAGE) : resolve(val);
});
promise["catch"](reject);
});
return wrappedPromise.cancel = function () {
return hasCanceled_ = true;
}, wrappedPromise;
}
exports.CANCELATION_MESSAGE = CANCELATION_MESSAGE;
exports.default = makeCancelable;

Xet Storage Details

Size:
744 Bytes
·
Xet hash:
439c42e214653f10a1d971b0f632db065492bc026230fcc84fda06ebf37cf6c9

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.