Комментарии:
Thank you! Very well explained! 💛
Ответитьold but gold! for me it was the jquary example. thanks a lot ninja master. 2023 and still the best explanation about eventemitter🐱👤
btw this can be updated in a new video ES6 style!
2023 here and node 18 , it say to me that .inherist is discurage
Ответитьtheme name 🥺.?
ОтветитьHi, This session, any example, for what is this normally used for. util.inherits(Person,events.EventEmitter); and other below codes.
Thx
thanks for this session, as a newbie, Im still confused about the emitter. might need to study harder, thanks Ninja.
ОтветитьI need to watch all your videos xD
Ответитьthx
ОтветитьBoss this could be done without an Array as well.
Ответитьhere by 2021.
what version of ECMA script is this code belong to?
wonder know that the util is mandatory structure due to get some inheritances.
bcoz some comments say it has changed OR replacement code is exist.
BTW thanks much.
usage of "util. inherits" discouraged. Please use the ES6 and keywords to get language level inheritance support. Also note that the two styles are semantically incompatible.
ОтветитьIts super awesome /easy to understand and ultra time saving❤️❤️🔥🔥
ОтветитьThank you
ОтветитьPSA:
var Person = (name) => {......} wont work in this case. it has to be the way it is shown in the video.
Can anyone explain why is it so?
Totally lost
Ответить// guys ignore this comment
// brief notes
const events = require('events");
var emitterObj = new events.EventEmitter(); // EventEmitter is object in event module
// creating an event
emitterObj.on('myEvent1', function(msg){
console.log(mssg);
} ); // function is executed when myEvent1 is emitted
emitterObj.emit('myEvent', 'argument to function' ); // after event name onwards rest are passed to function as param
I really enjoyed watching your video. but here I want to ask, why do you use the util module instead of just using classes? is there a difference in usage?. and by watching your video I am very grateful that your video gave me enough understanding for emitter event.
Ответитьthankyou sir. it's a big help to us.
ОтветитьThis is new to me
shouldn't Person extend another class like a normal peaceful class
why using util.inherit
edit after Googling
u can they are the same
use this instead
class Person extends EventEmitter {
constructor(name) {
super();
this.name = name;
}
}
You deserve more than a million subscriber man.
ОтветитьGood explanation, many thanks
ОтветитьHey I'm getting this error while trying to convert to ES6 as recommended by VSCode.
var events = require('events') converting this to import { EventEmitter } from 'events';
Error
import { events } from "events";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1047:16)
at Module._compile (internal/modules/cjs/loader.js:1097:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
Why doesn't it work when converted to EcmaScript6?
myEmmitter.On('someEvent',function(msg){
console.log(msg);
});
please some one tell me whats wrong in this function cause it doesn't work with me
I did not notice when we imported 'events' and 'utils', and where they are described (what .json)?
Ответитьhis accent is hard to get.
ОтветитьWhat's is the difference between utils.inherit and extends of ES6?
Ответитьok i got fuckin lost
ОтветитьThis is the first video in the series that really made me think to follow along the code and know what's going on.. I missed this feeling
ОтветитьGreat tutorial but I can't imagine a single practical application for this. I could do the exact same thing with less code using a method. And it would also make more sense to more developers because its not using proprietary features.
ОтветитьIt's like Classes and Objects in Python.
ОтветитьYour videos are great
Ответитьthe only info useful is the first 3 clips
Ответитьyou are the best
ОтветитьThis was a bit unclear to me.
1. What is the use of the events? I could have done that in a function called "speak" that accepts a message. What's the advantage of using an event here?
2. Inside the forEach, why do we need a function (the arg of the forEach), can't we just do a forEach that does the "on('speak'..." for each of the persons without using a function? Hard to explain..I hope you understood.
update ur node tutorial sensei
Ответитьthe function adder is not working to add numbers which u have explained in 7th video
ОтветитьYou have one of the best NodeJS educational material for beginners. Your videos are organized and to the point. I definitely would recommend it.
Ответить"let's go ahead and make some people" 😂
ОтветитьThanks .
Ответитьi am soo confused on what anything does...
Ответитьyou lost me when you used this in a function xD this is to be used in a class right ?
Ответить