Is there a simpler way of checking whether or not an async/await
network request is in progress before fetching again without the management of an extra state flag?
e.g.
var isFetching = false
func fetchStuff() {
guard !isFetching else { return }
do {
isFetching = true
self.stuff = try await getStuff()
} catch {
// ...
}
isFetching = false
}
Is there a simpler way than using this isFetching
flag?