You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
444 B
18 lines
444 B
import throttle from 'lodash.throttle'
|
|
|
|
function emitSocketProgress (uploader, progressData, file) {
|
|
const { progress, bytesUploaded, bytesTotal } = progressData
|
|
if (progress) {
|
|
uploader.uppy.log(`Upload progress: ${progress}`)
|
|
uploader.uppy.emit('upload-progress', file, {
|
|
uploader,
|
|
bytesUploaded,
|
|
bytesTotal,
|
|
})
|
|
}
|
|
}
|
|
|
|
export default throttle(emitSocketProgress, 300, {
|
|
leading: true,
|
|
trailing: true,
|
|
})
|
|
|