mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-01 19:32:27 +08:00
17 lines
377 B
JavaScript
17 lines
377 B
JavaScript
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();
|