Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions WorkflowSwiftUI/Sources/ObservableModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,9 @@ extension ObservableModel {
accessor.sendValue { $0[keyPath: keyPath] = newValue }
}
}

/// Allows dynamic member lookup to read state through the accessor.
public subscript<T>(dynamicMember keyPath: KeyPath<State, T>) -> T {
accessor.state[keyPath: keyPath]
}
}
Loading