code: function uploadFile(file) {
    var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _lodash2.default.noop;
  
    // const upload = new Upload(file);
    // upload.on('end', res => {
    //   console.log(res);
    // });
    // const options = {
    //   path: window.UPLOAD_PATH || '/api/uploads/',
    // };
    // upload.to(options);
  
    // Create a new tus upload
    var upload = new _tusJsClient2.default.Upload(file, {
      // TODO enable resumable uploads
      resume: false,
      endpoint: window.UPLOAD_PATH || '/api/uploads/',
      onError: function onError(err) {
        console.log('upload failed:', err);
        callback(null, err);
      },
      onProgress: function onProgress(bytesUploaded, bytesTotal) {
        var percentage = (bytesUploaded / bytesTotal * 100).toFixed(2);
        console.log('progress %s/%s, %s', bytesUploaded, bytesTotal, percentage + '%');
      },
      onSuccess: function onSuccess() {
        console.log('download %s from %s', upload.file.name, upload.url);
        callback({ name: upload.file.name, url: upload.url });
      }
    });
  
    // Start the upload
    upload.start();
  }
docs: TODO configurable upload client: tus, component-upload, etc