Files
2026-10-12 15:19:54 -04:00

12 lines
335 B
TypeScript

/** Runs a mutation whose failure the mutation itself reports, resolving whether it succeeded. */
export async function attempt(mutation: () => Promise<unknown>): Promise<boolean> {
try {
await mutation();
return true;
} catch {
// Error toast is handled by the mutation.
return false;
}
}