统一全系统资源加载、轻量趋势与缓存恢复

This commit is contained in:
2026-11-02 09:54:01 +08:00
parent 8b8f9b7728
commit b711327c8e
58 changed files with 3150 additions and 661 deletions
+17
View File
@@ -0,0 +1,17 @@
export function importIssuePageKey(runId: string, page: number): string {
return `${runId}:${page}`;
}
export function matchesImportIssuePage(loadedRunId: string, loadedPage: number, runId: string, page: number): boolean {
return loadedRunId === runId && loadedPage === page;
}
export async function runImportPollFollowup<T>(
runId: string,
isCurrent: (runId: string) => boolean,
followup: () => Promise<T>,
): Promise<{ started: false; current: false } | { started: true; current: boolean; value: T }> {
if (!isCurrent(runId)) return { started: false, current: false };
const value = await followup();
return { started: true, current: isCurrent(runId), value };
}