For example, if I have a module for emailing with a send() method on it,
I don't have it export a constructor; I have it export an object. That
object might maintain some state or it might not. When the module is
subsequently require()'d, it will have any state that it has accumulated
since.
Aah, nevermind then, I misunerstood ;)
21 lis 2013 16:36 Gregg Caines gr...@caines.ca napisaĆ(a):
Yeah... that's what I'm saying :)
G
On Thu, Nov 21, 2013 at 7:33 AM, Kamil Leszczuk kamit...@gmail.comwrote:
For example, if I have a module for emailing with a send() method on
it, I don't
'this' will be bound to the EventEmitter instance. This behaviour is
implemented around
here: https://github.com/joyent/node/blob/master/lib/events.js#L100.
So, the following code works as expected (prints called!).
var SomeClass = function () {
};
util.inherits(SomeClass, EventEmitter);
var