Conversation
|
Apparently github doesn't notify me about pull requests so that's cool. Anyway I'll look at this hopefully soon when I'm not being flattened by constant migraines since there's a lot. |
|
@Enichan no rush at all! And feel free to ask about any change, I'll gladly explain it in detail! |
|
So most of this looks good to me, although I'm a bit crusty so going 😒 at all the newfangled iterators, but that's a me problem. The big change I'd like to see is in regards to if statements, where I tend to prefer the "if" path to be the exceptional path, and the "else" path to be the default expected path, and I noticed this got reversed in some spots. |
Oh that's ok, I can reverse those. I just followed the common practice of avoid negated conditions. I'll update the PR later today 😊 |
| if (!isOnlyHashtags) { | ||
| return; | ||
| } | ||
|
|
||
| contents.removeChild(para); |
There was a problem hiding this comment.
It ends up being more code to do the same thing:
if (!a) { return; }
b();
// vs
if (a) { b() }... but I just updated the code to have the exceptional paths as requested.
|
Sorry for the delay @Enichan! It took a little bit longer because I didn't had the bandwidth to also deal with merging the new main (which has the |
|
No worries about the delay, I was sick so I'm still trying to catch up on stuff |
I took the liberty of going over the code in the
FediTagclass, and adding this fixes/features:_this = this: Those aren't necessary because you're using arrow functions that don't have their own context, so is safe to just usethis.==and!=an instead is recommended to always use===and!==.document.getElementById: Saved the reference to the elements in class properties and use those references instead. This also would remove the need forid(I didn't made this change myself, but I recommend it to avoid id collision).constructorsetup: You can do the initial setup of properties when declaring them directly on the body of the class.for: Usages offorcould be easily replaced with Array methods such asforEach,some,reduceand more.There's a bunch more improvements that could be done, happy to do those if you like these! 😊