vendredi 3 février 2017

Can a Module Pattern object inherit from a Constructor Pattern object?

(I'm a bit new to javascript and the whole prototype/inheritance concept, so my apologies if this is a dumb question)

In my codebase, I've got a mishmash of Revealing-Module-Pattern type of objects, and then I've also got objects that use the Constructor-Pattern (where instances get newed-up).

I also have a block of code (written in the constructor-type-pattern) which provides EventEmitter functionality. Is it possible to use this code as a base class for both Constructor-Pattern objects and Revealing-Module-Pattern objects? Does trying to do this even make sense?

Aucun commentaire:

Enregistrer un commentaire