Contents

DeferredProperty()

A macro that creates an async property for an AppEntity that allows for providing an async 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

Entity property macros