automerge / automerge-swift

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

update Counter, and refactor schema creation logic #151

Open heckj opened 2 months ago

heckj commented 2 months ago

For "bound" types - Counter and AutomergeText, only the AutomergeText initializer that takes a "path" will create the schema (if it doesn't exist and doesn't conflict). That logic is a bit of mess, and really needs to be extracted, and a similiar mechanism used for Counter - which still requires schema in an Automerge Document to be created before invoking bind() on it.