Currently, property wrappers in Swift provide great abstractions for common tasks like validation, caching, and data binding. However, I’ve been wondering whether there’s a way to introduce async property wrappers—something that allows asynchronous actions or network requests directly in a property’s getter or setter.
How do you think this could fit into Swift? Would it make code cleaner, or introduce complexity that could complicate debugging and performance?
I believe the author is asking here about property wrappers providing their wrappedValue or projectedValue as a computed property with such getter.
IMHO while a nice addition to property wrappers, property wrappers themselves currently feel somewhat like a misfeature in the presence of macros. Not sure if they're worth allocating resources for.