fix dangling download

This commit is contained in:
2022-01-27 18:11:13 +01:00
parent 8c10868dd0
commit 8ff853b688
4 changed files with 31 additions and 26 deletions

View File

@@ -26,4 +26,13 @@ export function detectSpeed(str: string): number {
default:
return 0
}
}
}
export const updateInStateMap = (k: number, v: any, target: Map<number, any>, callback: Function, remove: boolean = false) => {
if (remove) {
target.delete(k)
callback(new Map(target))
return;
}
callback(new Map(target.set(k, v)));
}