1
0
Fork 0

Update with reviewer feedback

pull/513/head
Dave Hadka 2020-07-13 16:07:58 -05:00
parent cc474239c9
commit c4a92b0b60
1 changed files with 6 additions and 8 deletions

View File

@ -120,12 +120,12 @@ export class DownloadProgress {
}
/**
* Callback used to update the progress.
*
* @param progress the progress event
* Returns a function used to handle TransferProgressEvents.
*/
onProgressCallback(progress: TransferProgressEvent): void {
this.setReceivedBytes(progress.loadedBytes)
onProgress(): (progress: TransferProgressEvent) => void {
return (progress: TransferProgressEvent) => {
this.setReceivedBytes(progress.loadedBytes)
}
}
/**
@ -261,9 +261,7 @@ export async function downloadCacheStorageSDK(
segmentSize,
{
concurrency: options.downloadConcurrency,
onProgress: downloadProgress.onProgressCallback.bind(
downloadProgress
)
onProgress: downloadProgress.onProgress()
}
)