refactor(catalog): unify commands and embed guarded catalog workspace
This commit is contained in:
1 parent
16f35568f5
commit
193b6686a9
57 files changed
+3268
-728
No files matched your search
@@ -0,0 +1,19 @@
|
||||
/** Cancels replaced requests and rejects late completions, even if transport ignores abort. */
|
||||
export function createLatestRequest() {
|
||||
let current: AbortController | null = null;
|
||||
return {
|
||||
start() {
|
||||
current?.abort();
|
||||
const controller = new AbortController();
|
||||
current = controller;
|
||||
return {
|
||||
signal: controller.signal,
|
||||
isCurrent: () => current === controller && !controller.signal.aborted,
|
||||
};
|
||||
},
|
||||
cancel() {
|
||||
current?.abort();
|
||||
current = null;
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user