-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Splice for with Object elements #102
Comments
I'm assuming you're talking about splice and not spliceText. Assuming you are, it applies to any sequence ( You can use the custom Codable pieces enabled in Swift Automerge to encode an array into place, or if you want to control the lower-level access, you can convert your own objects into something and drop them into place manually. The Look through the relevant methods under "Updating lists" at https://automerge.org/automerge-swift/documentation/automerge/document for the controls you have to update/manage lists yourself. (As you know, Automerge lists aren't strictly typed - but standard Swift arrays are - they're all of the same time. That constraint was built into the Codable encoder/decoder - so if you want a dynamic list, I'm afraid you'll have to assume the burden to assemble things yourself and handle the "what if it's not the type I expect" scenarios) |
Splice is very useful to build all kinds of functionality (append, remove, ...). How would I splice elements which are objects/codable objects.
The text was updated successfully, but these errors were encountered: