Improve example by using an approach similar to https://www.swiftbysundell.com/articles/handling-loading-states-in-swiftui/