Files
2026-11-14 09:56:45 +00:00

14 lines
386 B
TypeScript

/** Component-memory only. Identical retries retain their key; every changed submission gets a new one. */
export function retryIdentity() {
let previous: string | undefined
let key: string
return (payload: unknown): string => {
const next = JSON.stringify(payload)
if (next !== previous) {
previous = next
key = crypto.randomUUID()
}
return key
}
}