refactor: 리펙토링
This commit is contained in:
@@ -237,12 +237,17 @@ export function createTanStackCacheCoordinator(
|
||||
} catch {
|
||||
report("reset-flush");
|
||||
}
|
||||
let cancellationFailed = false;
|
||||
try {
|
||||
await dependencies.queryClient.cancelQueries();
|
||||
} catch {
|
||||
report("reset-cancel");
|
||||
cancellationFailed = true;
|
||||
}
|
||||
dependencies.queryClient.clear();
|
||||
if (cancellationFailed) {
|
||||
throw new TypeError("mandatory query cancellation failed");
|
||||
}
|
||||
})().finally(() => {
|
||||
resetting = false;
|
||||
resetPromise = null;
|
||||
@@ -299,11 +304,9 @@ function buildDefinitions(
|
||||
}),
|
||||
);
|
||||
}
|
||||
if (definitions.size === 0) {
|
||||
throw new TypeError(
|
||||
"Query invalidation registry requires at least one topic.",
|
||||
);
|
||||
}
|
||||
// An empty registry is a legitimate state: a template with no installed
|
||||
// feature has no invalidation topic. Every per-entry rule above still
|
||||
// applies, and an unregistered topic still fails at the call site.
|
||||
return definitions;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user