Will think of a better solution...
Can you explain the disadvantage of doing blah.prototype inside the class function?

Enviado desde mi BlackBerry

-----Original Message-----
From: Tomas Neme <notifications@github.com>
Date: Sat, 13 Apr 2013 16:30:41 
To: inaes-tic/mbc-mosto<mbc-mosto@noreply.github.com>
Reply-To: inaes-tic/mbc-mosto <reply@reply.github.com>
Cc: Juan Martin Runge<jmrunge@gmail.com>
Subject: Re: [mbc-mosto] NOT FOR MERGE please review (#54)

> +
> +        this.status = _.extend(this.status, status);
> +        // except next. If that's undefined, I just don't know!
> +        this.status.show.next = status.show.next;
> +        this.publishStatus(status);
> +    };
> +    CaspaDriver.prototype.publishStatus = function(status) {
> +        this.publisher.publish({backend: "mostoStatus", model: status})
> +    };
> +}
> +
> +util.inherits(CaspaDriver, events.EventEmitter);
> +
> +exports = module.exports = function() {
> +    driver = new CaspaDriver();
> +    driver.setupAll();

I need to call this from here because I had too many "undefined" errors which led to ugly workarounds if I called it from the constructor function. If anyone can think of a better structure for this, please do say so.

By the way, I've been recommended against doing the whole `Class.prototype.method = function()` thing INSIDE the function itself in #node.js (freenode)

---
Reply to this email directly or view it on GitHub:
https://github.com/inaes-tic/mbc-mosto/pull/54/files#r3784757