javascript - Replacing original EventEmitter with custom one -
consider want use eventemitter2
, or implementation of eventemitter
of own. however, if eventemitter = myeventemitter
, helps explicit inheritance happens after declaration, won't change existing objects inheriting builtin eventemitter
, , limited scope of module.
can take advantage of alternative eventemitter
s when using builtin objects? can think of descending prototype chain of particular object, , if prototype appears instance of eventemitter
, replace own, isn't there more elegant way?
Comments
Post a Comment