Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I really like the code, I think it's very well written!

A couple small suggestions and thoughts:

Add a couple lines so that all methods return this; to allow for chaining, especially helpful when using it as a mixin.

Rename bind/unbind method names since they have completely different meanings/uses in ES5:

https://developer.mozilla.org/en/JavaScript/Reference/Global...

P.S. If you're down with those changes I'll gladly fork, update and send a pull req, although not sure what you'd want to rename the api too.



i had chained api before, and removed it for shortness.

your point on api name is good. which name would you suggest ? something standard and readable and im sold :)


Since I'll probably be using this for a couple smaller things of mine, I forked it and went ahead and changed it to:

subscribe/unsubscribe/publish

and also added return this.

https://github.com/amadeus/microevent.js


cool. will look at it. lets take this on github




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: