vscode: reduce throttle latency of downloadFile() progress callback for smoother UX

This commit is contained in:
Veetaha 2020-02-08 21:25:03 +02:00
parent 9791b6a8de
commit bdd88c2fad

View File

@ -13,7 +13,7 @@ export async function downloadFile(
destFilePath: fs.PathLike, destFilePath: fs.PathLike,
onProgress: (readBytes: number, totalBytes: number) => void onProgress: (readBytes: number, totalBytes: number) => void
): Promise<void> { ): Promise<void> {
onProgress = throttle(500, /* noTrailing: */ true, onProgress); onProgress = throttle(200, /* noTrailing: */ true, onProgress);
const response = await fetch(url); const response = await fetch(url);