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:
@@ -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;
|
||||
Reference in New Issue
Block a user