Skip to content

Commit

Permalink
Update with reviewer feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dhadka committed Jul 13, 2020
1 parent cc47423 commit c4a92b0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/cache/src/internal/downloadUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

/**
Expand Down Expand Up @@ -261,9 +261,7 @@ export async function downloadCacheStorageSDK(
segmentSize,
{
concurrency: options.downloadConcurrency,
onProgress: downloadProgress.onProgressCallback.bind(
downloadProgress
)
onProgress: downloadProgress.onProgress()
}
)

Expand Down

0 comments on commit c4a92b0

Please sign in to comment.