2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

Adding Cancel and CancelToken classes

This commit is contained in:
Nick Uraltsev
2016-09-15 21:06:32 -07:00
parent 59080e68d9
commit b2bc3354ac
4 changed files with 176 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
'use strict';
/**
* A `Cancel` is an object that is thrown when an operation is canceled.
*
* @class
* @param {string=} message The message.
*/
function Cancel(message) {
this.message = message;
}
Cancel.prototype.toString = function toString() {
return 'Cancel' + (this.message ? ': ' + this.message : '');
};
module.exports = Cancel;