DeferredProperty()
A macro that adds an asynchronous app entity property with an asynchronous get accessor.
Declaration
@attached(peer, names: prefixed(`$`), prefixed(`_`)) @attached(accessor, names: named(get), named(set)) macro DeferredProperty()Example
struct Restaurant: AppEntity {
var model: Menu
@DeferredProperty
var popularItems: [MenuItem] {
get async {
await model.server.popularMenuItems()
}
}
}See Also
Property declarations
ComputedProperty()ComputedProperty(title:)ComputedProperty(indexingKey:)ComputedProperty(customIndexingKey:)ComputedProperty(title:customIndexingKey:)ComputedProperty(title:indexingKey:)DeferredProperty(title:)DeferredProperty(indexingKey:)DeferredProperty(title:indexingKey:)EntityPropertyEntityPropertyModifiersProperty comparators