mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-27 20:27:13 +00:00
And rewrite all the require calls. ```bash git mv src/utils/* packages/@uppy/utils/src sed -i 's/[./]*\/utils\//@uppy\/utils\/lib\//' src/**/*.js # transform (../)*utils → @uppy/utils ```
15 lines
472 B
JavaScript
15 lines
472 B
JavaScript
const throttle = require('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: bytesUploaded,
|
|
bytesTotal: bytesTotal
|
|
})
|
|
}
|
|
}
|
|
|
|
module.exports = throttle(_emitSocketProgress, 300, {leading: true, trailing: true})
|