Closed luwes closed 5 years ago
The reason is that custom functions (like collect
) are not copied on cloning.
And you calling .collect(node)
on template node returned from h
function, not on the cloned one.
For nodes, that are not cloned and used directly, it could be reasonable, but not consistent with API.
I think clone-collect can be considered as default usage pattern, that's why API implemented in favor of this.
Here is one example: https://github.com/Freak613/stage0/blob/master/examples/sierpinski/app.js#L49 Check out examples folder, it demonstrates this pattern very well.
Thanks for this great lib!
I was wondering why the api for this call is
node.collect(node)
? Since it's called on the same object couldn't it benode.collect()
?