Re:Show HN: Tired of logic in useEffect, I built a class-bas...
by hungryhobbit on Wednesday April 08, 2026 @07:44PM
(#47697615)
Essentially `new Foo()`, where `Foo` can be a subclass of `Bar` that inherits properties in the same way we all learned in our Java (or whatever actual OOP) language.
JavaScript gives you a class syntax that lets you make classes and extend them from each other, and for the most part they will work the same way as a class from a language like Java ... but some things won't.
You can either become an expert on prototype chains, and how JS actually implements OOP (differently from Java) ... or you can just write factory functions instead of classes.
Re:Show HN: Tired of logic in useEffect, I built a class-bas...
by kretaceous on Wednesday April 08, 2026 @08:05PM
(#47697745)
Can you give examples of how they are different? I've only done OOP in JS so I'm not aware of what I'm missing or what's supposed to be different.
(disclaimer: FP all the way, regardless)