this.setup = function () {
this.on('tweet', this.handleStreamEvent.bind(this, 'tweet'));
this.on('retweet', this.handleStreamEvent.bind(this, 'retweet'));
};
This pattern will be obsolote as soon as arrow function gets implemented by all major browsers: this.setup = function () {
this.on('tweet', () => this.handleStreamEvent('tweet'));
this.on('retweet', () => this.handleStreamEvent('retweet'));
};
GitHub is very poor on that matter.