Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
olback107946yIn my opinion, this:
return data.map((item) => {
should be this instead:
return data.map(item => {
Makes it more readable for me at least. Other than that, it's looking great. -
perotti7876yDoes "this" in typescript static method references to the Class itself?
Otherwise, swap it with the actual class -
@perotti it reference the class and vs code added it when I chose the method.
However; I changed it to regular class instead of static methods, is it ok if I ping you when I'm done fixing it? -
Code looks perfect however you might need to add comment tags to tell if it's a function/constructor/generator etc. Also use return tags to tell the reader of its type and description. This should help you - http://usejsdoc.org
-
Not to mention that the comment above might not be needed for a simple example like this one but would definitely help in a large code base with multiple authors :)
-
@varundey all feedbacks are appreciated, I will read the link you gave. And I don't really care if the code was for my project or a large project, my goal is to train my self to do it the right way
Related Rants
I'm still learning so take it easy on me, I'm trying to learn typescript and Factory pattern, hope I did it correctly this time :)
Link: https://pastebin.com/99AL3qah
Its only one class in hope I got it right so I can continue with the others
question
did i do it right?
typescript