in ReScript is there a better way to call an async function inside an event handler than using ->ignore
?
Need to call this async function inside an onClick
but get compiler error unless I call it with ->ignore
.
let handleDuplicateQuote = async () => {
try {
await mutation_duplicateQuote({quoteId: quote._id})
} catch {
| Js.Exn.Error(err) => Js.log2("Failure!!", err)
}
}
onClick
onClick={_ => {
handleDuplicateQuote()->ignore
}}
I wonder if there is a better way