Allow specifying props for top node created by Tree.build #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "topProps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is it not easy enough to, after calling
Tree.build, usenew Tree(tree.type, tree.children, tree.positions, tree.length, myProps)to create the tree with props you're looking for?Oh yeah I didn't think of that. I think the API would compose better if there was a type for the content of a tree (children, positions, length), be it
TreeContent... then we could haveTreeContent.build()and the Tree constructor could take just type, content and props and we wouldn't have to pass atopIDto a function that doesn't actually care about it or do such a ring-around-the-rosy dance. But yeah this is probably not important enough to warrant such a breaking change.Pull request closed