Last active
August 29, 2015 14:17
-
-
Save aboutlo/6ca980ccadeccc32bfd8 to your computer and use it in GitHub Desktop.
es6 example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import _ from 'underscore'; // _ is white | |
import { EventEmitter } from 'events'; // EventeEmitter is white | |
import logger from 'loglevel'; // logger is white | |
let emitter = new EventEmitter(); | |
var Foo = function () { | |
}; | |
_.extend(Foo.prototype, { | |
send(method, data) { // send is white | |
emitter.emit(method); | |
this.bar(data); // bar is blue | |
}, | |
on(event, callback) { // on is white | |
emitter.on(event,callback); | |
// DO STUFF | |
}, | |
bar(data) { // bar is white | |
// DO STUFF | |
} | |
}); | |
export default Foo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment