Restoring state #221
-
It is possible I am missing something, but I am struggling to find a method for restoring state. I am able to write a method to export nodes after first doing {
"YZ1fx6kA2R": {
"id": "YZ1fx6kA2R",
"x": -198,
"y": -182,
"type": "string",
"width": 200,
"connections": {
"inputs": {},
"outputs": {}
},
"inputData": {
"string": {
"string": ""
}
}
}
} What is missing (from what I can see) is a way to go the other way. I see there is a PR #197 to add a method to set all nodes, but I would also like to be able to restore comments too. I was wondering about using something like the dispatch methods to remove then add nodes in a loop but they don't appear to be exposed either. This feels like essential functionality? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is definitely possible, I think I need to update the docs to make this a little more clear. There's |
Beta Was this translation helpful? Give feedback.
This is definitely possible, I think I need to update the docs to make this a little more clear. There's
nodes
andcomments
props you can use to hydrate the nodeEditor with nodes and comments. https://flume.dev/docs/NodeEditor#nodes--object. The deficiency right now is these props only work when the nodeEditor is first initialized. In a future version you should be able to set this prop at any point.