Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context parameter for event listeners #36

Closed
Firanolfind opened this issue Jun 17, 2018 · 0 comments
Closed

Context parameter for event listeners #36

Firanolfind opened this issue Jun 17, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@Firanolfind
Copy link

@Firanolfind Firanolfind commented Jun 17, 2018

Hi, I would like to suggest an enhancement.
Context param in methods .on, .once, .addListener might be useful.

var app = new myApp;

podiumObject.on('event1', listener1, app);
podiumObject.once('event1', listener1, app);
podiumObject.addListener('event1', listener1, app);

That means we can get rid of using fn.bind to apply custom context. It could reduce overhead for event listeners, as far as fn.apply does not create new function.
If it make sense I can make PR.

@hueniverse hueniverse self-assigned this Nov 11, 2018
@hueniverse hueniverse added the request label Nov 11, 2018
@hueniverse hueniverse added this to the 3.1.6 milestone Nov 11, 2018
@Marsup Marsup added feature and removed request labels Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.