Closed michaelpalumbo closed 2 years ago
Hi @michaelpalumbo, the only problem I can find with this code is that the definition of nodeID
should presumably be a string literal. If I add the missing quotation marks and initialise doc1 = Automerge.from({scene: {nodes: {}}})
then this code works fine for me and does not throw any exception. Could you please post a complete example that reproduces the exception?
@ept ah I'm sorry that was a typo when I wrote the github issue, i pasted it in and forgot to include the quotation marks. yes, the nodeID is a string literal.
I'm using threeJS, and I'd like to store elements instanced to the scene graph in an automerge document. After some experimentation I learned that threeJS stores a function in the rotation
object, and it seems that is what automerge is not agreeing with. For now, I can just filter out that function, as I only need the euler angles themselves in order to rebuild the scene on load or on another client.
Okay, filtering out the function is probably the way to go. As far as I know there is no sensible way of serialising a JS function (even if you get its source, it wouldn't include the context in which it is defined, e.g. any other functions it may call) so I don't see any way of supporting functions within Automerge documents.
Hi there. I'm getting a strange behavior when I pass variables into the automerge.change().
My code is: