retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
10.17k stars 653 forks source link

update view #335

Closed mohandass-pat closed 5 years ago

mohandass-pat commented 5 years ago

Hi. Actually this is a great tool. Really thanks for this. I have a small doubt. How to update the view after dynamically changing node data?

I referred this https://jsfiddle.net/Ni55aN/8pfqb9yy/22/.

where I tried this one , editor.nodes.find(n => n.id == id).data._done = true editor.view.update()

but update function is returning error. Actually I using the react component

Ni55aN commented 5 years ago

editor.view doesn't have update() function.

const node = editor.nodes.find(n => n.id == id);
node.data._done = true
await node.update();
mohandass-pat commented 5 years ago

Yeah It works. Thanks a lot.