Extending the Event Emitter

preview_player
Показать описание

Subscribe for more videos:

Want to learn more from me? Check out my blog and courses:
Рекомендации по теме
Комментарии
Автор

This is under rated quality material. Good job 👏 we need more advanced tutorials like these.

anamoly
Автор

What a fantastic tutorial. Thank you very much!

jawamaster
Автор

Perfect tutorial of the event emitter ;)

scottchang
Автор

Thanks for the clear explanations! Great job

s_lth
Автор

Hi, great video, just a quick note. I assume on app.js we would no longer need to require the event emitter at all as this now handled by the logger class? Or am I missing something

ec-kf
Автор

hey mosh ... good video ... thank you.
one note: imho you present a solution which is possible, but you should'nt use inheritance for this case. Extends means in this case 'logger is a emitter' ... normally this isn't the case. OK ... you can argument, you have now a LoggerEmitter ... But imho a better solution is a "has a" relationship. Logger is certainly only a example for extending event emitter ... I think in the most cases the "is a" releationship isn't the correct solution. If you use a "has a" relationship then your Logger is still a Logger and not a LoggerEmitter. And if you don't want to access the emitter property directly, you can wrap the emitter methods with own methods. Then you can name the methods to interact with the emitter better to your class usecase.

NullPointerHunter
Автор

hey mosh hii, i want to know when is your nodejs course is comming im very exited for that please let me know...

noormohammedshikalgar
Автор

hello, it's possible to send a string to another file.js?
i'm trying to do but i can only use 2 file.js if i'm using a third one the code show emitter is not a constructor

axedexango
Автор

Why would you add the messageLogged event outside the class? Shouldnt this be inside the class? Also, you are using "messageLogged" to define and to call the method. Should we make that a constant so we are not using "magic strings"?

qwarlockz
Автор

why do "eventemitter"s r different on each module??

veliea
Автор

this.emit() doesn't fire for some reason

sameerkulkarni
Автор

Did not understand anything .. very complex tutorial and I bought the whole course....

itaybeyder