@@ -0,0 +1,13 @@
|
||||
/** 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user