UNPKG

1.64 kBJavaScriptView Raw
1import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
2import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
3import _inherits from 'babel-runtime/helpers/inherits';
4import { Component } from 'react';
5
6var Base = function (_Component) {
7 _inherits(Base, _Component);
8
9 function Base() {
10 var _temp, _this, _ret;
11
12 _classCallCheck(this, Base);
13
14 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
15 args[_key] = arguments[_key];
16 }
17
18 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.saveUploaderRef = function (ref) {
19 /* istanbul ignore if */
20 if (ref && typeof ref.getInstance === 'function') {
21 _this.uploaderRef = ref.getInstance();
22 } else {
23 _this.uploaderRef = ref;
24 }
25 }, _temp), _possibleConstructorReturn(_this, _ret);
26 }
27
28 /* istanbul ignore next */
29 Base.prototype.abort = function abort(file) {
30 /* istanbul ignore next */
31 this.uploaderRef.abort(file);
32 };
33 /* istanbul ignore next */
34
35
36 Base.prototype.startUpload = function startUpload() {
37 /* istanbul ignore next */
38 this.uploaderRef.startUpload();
39 };
40
41 /* istanbul ignore next */
42 Base.prototype.isUploading = function isUploading() {
43 /* istanbul ignore next */
44 return this.uploaderRef.isUploading();
45 };
46
47 return Base;
48}(Component);
49
50Base.displayName = 'Base';
51export { Base as default };
\No newline at end of file