I have a @State
variable and async function. I want to call the async function whenever that variable is changed.
Basically, what I am trying to do
VStack {
Text("")
}
.onChange(of: var) { newValue in
await asyncFunction()
}
But this gives me the following error
Cannot pass function of type '(Int) async -> ()' to parameter expecting synchronous function type