feature (upload): upload queue that show progress with abort and retry - #267

This commit is contained in:
Sergei Azarkin
2020-05-23 08:43:39 +02:00
committed by GitHub
parent b58cb5ebd2
commit 865ba7ded6
13 changed files with 522 additions and 208 deletions

16
client/helpers/upload.js Normal file
View File

@ -0,0 +1,16 @@
const Upload = function () {
let fn = null;
return {
add: function (path, files) {
if (!fn) { return window.setTimeout(() => this.add(path, files), 50); }
fn(path, files);
return Promise.resolve();
},
subscribe: function (_fn) {
fn = _fn;
}
};
};
export const upload = new Upload();