What would be the proper way to avoid Task {} inside a .onReceive() closure and still be able to run async code?
If I add a Task {} everything runs as it should but shouldn't I replace all Task {} blocks in swiftui? Whenever possible I'm using .task directly on the view but in this case I need to run an URLSession from a publisher onReceive closure.
You can have the
onReceivealter a variable that serves as anidfortask.