I really don’t like the no-semicolons JS style. I’ve seen the arguments that it’s more elegant, but a combination of “it looks wrong” and “you can get very surprising bugs in cases where the insertion algorithm doesn’t quite match our intuitions” is too much.
What’s the advantage of making alreadyClicked a set instead of keeping it as a property of the things it’s clicking on?
In this case I’m not at all worried about memory leaks, since the tab will only exist for a couple seconds.
The getExpandableComments simplification is nice!
I haven’t tested it, but I think your collectComments has a bug in it where it will include replies as if they are top level comments in addition to including them as replies to the appropriate top level comments.
Interesting to read through! Thoughts:
I really don’t like the no-semicolons JS style. I’ve seen the arguments that it’s more elegant, but a combination of “it looks wrong” and “you can get very surprising bugs in cases where the insertion algorithm doesn’t quite match our intuitions” is too much.
What’s the advantage of making
alreadyClickeda set instead of keeping it as a property of the things it’s clicking on?In this case I’m not at all worried about memory leaks, since the tab will only exist for a couple seconds.
The
getExpandableCommentssimplification is nice!I haven’t tested it, but I think your
collectCommentshas a bug in it where it will include replies as if they are top level comments in addition to including them as replies to the appropriate top level comments.