Closed phcreery closed 3 years ago
Woah, sweet, thank you very much for this! I'll take a look at it now
Now it looks more like this:
const serializedDocument = {
elements: [
{
id: '9581a4b6-8f14-416c-a761-43c7459ffe33',
typeName: 'scope-element',
name: '',
position: {
x: 0,
y: 0,
},
size: {
x: 0,
y: 0,
},
resizable: false,
closed: false,
},
{
id: '0e6f0520-0a52-4214-a12a-2d154325f198',
typeName: 'expression-element',
position: {
x: 7,
y: 5,
},
size: {
x: 5,
y: 2,
},
resizable: false,
expression: [
'Assign',
'a',
{
num: '3',
},
],
},
],
}
Cool, glad to see that you got the IDs to work. And woah, I've been using the uuid library for who knows how long, but I didn't know about the validate
function. Makes me happy to also learn something new
This looks good, I'd be happy to merge it. Would you like to implement the deserializeElement functions or should I take care of that?
I'll probably also tweak small a thing or two and then tell you about it :)
This is a draft pull request for serialization. I am sure I have not covered everything but I wanted to open this up to bring up any potential discussion or questions.
https://github.com/stefnotch/quantum-sheet/projects/1#card-42110934