The previously applied output (or null if none yet).
The output about to be applied.
Whether they are visually equivalent.
isSameBadgeOutput({ kind: "text", value: "5" }, { kind: "text", value: "5" }); // true
isSameBadgeOutput({ kind: "animate" }, { kind: "clear" }); // false
export function isSameBadgeOutput(a: BadgeOutput | null, b: BadgeOutput): boolean {
if (a === null || a.kind !== b.kind) return false;
if (a.kind === 'text' && b.kind === 'text') return a.value === b.value;
return true;
}
True when two BadgeOutputs would put the badge in the same visible state. Used to skip redundant re-applies within a session — most importantly, so a repeated
animatedoesn't restart (and visibly reset) the ellipsis cycle.