automerge / automerge-swift

Swift language bindings presenting Automerge
https://automerge.org/automerge-swift/documentation/automerge/
MIT License
233 stars 13 forks source link

Text as a reference type instead of a value type for performance of updates #59

Closed heckj closed 1 year ago

heckj commented 1 year ago

Converts the type AutomergeText from a placeholder value type into a reference type. When initialized empty, it acts the same as AutomergeText (with the exception of being a reference type, of course) - and when bound to an Automerge document, it attempts to write any initial value into place, and otherwise provides an ObservableObject that can also vend a SwiftUI Binding to update fields without having to incur a structural rebuild with a full decode cycle.

In short, it's an optimization for displaying Text through to a SwiftUI app.