Suggested way to bulk update nodes of a tree #71
-
First of all thanks for the awesome library! I am building a file tree and I am wondering what's the expected way to replace all the nodes in a tree with a new collection? Should I set I am thinking about things like refreshing after a file/folder was changed, or just changing the root to a new path. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hey, thanks for trying it out! 😃 Yeah, that's a use-case I forgot about when implementing it.
I think you shouldn't do that and only use the public APIs documented in the documentation.
I just added the |
Beta Was this translation helpful? Give feedback.
-
That's perfect, thanks! |
Beta Was this translation helpful? Give feedback.
Hey, thanks for trying it out! 😃
Yeah, that's a use-case I forgot about when implementing it.
I think you shouldn't do that and only use the public APIs documented in the documentation.
You can do that for now.But the real solution would be to add an API liketree:set_nodes(nodes)
that takes a list and replaces all the nodes. That would be useful for this use-case, right?I just added the
tree:set_nodes
method, and that would be the recommended way of doin…