Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Add aliases for some functions #35

Merged
merged 1 commit into from Nov 1, 2012
Merged

Conversation

Hebo
Copy link
Contributor

@Hebo Hebo commented Oct 30, 2012

This mirrors the Backbonejs events API and to a lesser extent the
Nodejs events API.

  • on() = addListener()
  • off() = removeListener()
  • trigger() = emitEvent()

We use use EventEmitter in more places than Backbone, so it's nice to be able to use the same API between objects that mixin Backbone.Events and those that mixin EventEmitter.

This mirrors the Backbonejs events API and to a lesser extent the
Nodejs events API.

on() = addListener()
off() = removeListener()
trigger() = emitEvent()
@Hebo
Copy link
Contributor Author

Hebo commented Oct 30, 2012

Looking over at the closed issues, it seems a similar alias was added in #24, but removed in a rewrite (a13f34e).

@Olical
Copy link
Owner

Olical commented Oct 30, 2012

Yep, they were there at one point but I left them out when I cleaned the whole thing up. I have to admit that addListener is a little long winded. I don't think it's such a bad thing to add them back in. Especially if it makes it a bit easier for everyone to type.

I will merge this in very soon and add each method to the documentation specifying that it's an alias. Thank you!

@Olical Olical merged commit a324893 into Olical:master Nov 1, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants