igorw/evenement — pull request #15 by reenl (2013-07-16 21:15:54+00:00)
Title: Indexed event listeners

I pretty much made this PR to start a discussion.

In this PR:
- Indexed listeners.
- Listeners cannot be added twice. #7 is related.
- Performance of removeListener is significantly improved with a lot of listeners O(N) to Olog(N).

Bug in this PR:
- With once a duplicate listener can be added. (This is fixable).

Do you think this is a common use case and are you willing to support it? If so, we might want to make a different trait, so you can choose whatever case suits your project best.