diff --git a/WorkflowSwiftUI/Sources/ObservableModel.swift b/WorkflowSwiftUI/Sources/ObservableModel.swift index 2a22b7c32..1c8d4cedd 100644 --- a/WorkflowSwiftUI/Sources/ObservableModel.swift +++ b/WorkflowSwiftUI/Sources/ObservableModel.swift @@ -147,4 +147,9 @@ extension ObservableModel { accessor.sendValue { $0[keyPath: keyPath] = newValue } } } + + /// Allows dynamic member lookup to read state through the accessor. + public subscript(dynamicMember keyPath: KeyPath) -> T { + accessor.state[keyPath: keyPath] + } }