mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
- convert cjs to esm - refactor from jest to vitest closes #3979 --------- Co-authored-by: Merlijn Vos <merlijn@soverin.net>
21 lines
445 B
JavaScript
21 lines
445 B
JavaScript
export class Upload {
|
|
constructor(file, options) {
|
|
this.url = 'https://tus.endpoint/files/foo-bar'
|
|
this.options = options
|
|
}
|
|
|
|
_triggerProgressThenSuccess() {
|
|
this.options.onProgress(this.options.uploadSize, this.options.uploadSize)
|
|
setTimeout(() => this.options.onSuccess(), 100)
|
|
}
|
|
|
|
start() {
|
|
setTimeout(this._triggerProgressThenSuccess.bind(this), 100)
|
|
}
|
|
|
|
abort() {
|
|
// noop
|
|
}
|
|
}
|
|
|
|
export default { Upload }
|