* feat: add file manager module - Complete file manager implementation with UI/UX - Add drive management functionality - Add file upload/download with progress tracking - Add stamp integration and handling - Add bulk operations and context menus Co-authored-by: Roland Seres <roland.seres90@gmail.com> Co-authored-by: nidishk <nidishkrishnan45@gmail.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
export class AbortManager {
|
||||
private controllers = new Map<string, AbortController>()
|
||||
|
||||
create(key: string): AbortController | undefined {
|
||||
if (!this.controllers.has(key)) {
|
||||
this.controllers.set(key, new AbortController())
|
||||
}
|
||||
|
||||
return this.controllers.get(key)
|
||||
}
|
||||
|
||||
getSignal(key: string): AbortSignal | undefined {
|
||||
return this.controllers.get(key)?.signal
|
||||
}
|
||||
|
||||
abort(key: string): void {
|
||||
const controller = this.controllers.get(key)
|
||||
controller?.abort()
|
||||
this.controllers.delete(key)
|
||||
}
|
||||
|
||||
has(key: string): boolean {
|
||||
return this.controllers.has(key)
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
this.controllers.forEach(controller => controller.abort())
|
||||
this.controllers.clear()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user