type OpenTotalPayload = { total?: number; items?: unknown[] } export function loadTaskOpenTotal( request: () => Promise, isCurrent: () => boolean, commit: (value: number) => void, ) { void request() .then((data) => { if (isCurrent()) commit(Number(data.total ?? data.items?.length ?? 0)) }) .catch(() => { /* Summary failure is intentionally non-fatal. */ }) }