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

Rewrite on('didInsertElement') and on('willDestroyElement') to override and call super instead #11

Open
abuiles opened this issue Mar 30, 2015 · 6 comments
Milestone

Comments

@abuiles
Copy link
Owner

abuiles commented Mar 30, 2015

cc @fivetanley

@abuiles abuiles added this to the 1.0 milestone Mar 30, 2015
@lolmaus
Copy link

lolmaus commented Aug 31, 2017

Why?

@knownasilya
Copy link
Collaborator

Those events have hooks, which is the new standard way of changing them. It prevents unexpected behavior, especially if you have multiple events, which you cannot do with the hooks.

@lolmaus
Copy link

lolmaus commented Aug 31, 2017

I've seen recommendations to migrate from hooks to events. O-o

@knownasilya
Copy link
Collaborator

Maybe for actual browser events? Like click or submit?

@lolmaus
Copy link

lolmaus commented Aug 31, 2017

Found a very old example: https://dockyard.com/blog/2014/04/28/dont-override-init

But I've seen more recent ones with the same idea.

I personally haven't seen any difference with the two approaches, unless I need to control the order, but I've never had a practical case of that.

@knownasilya
Copy link
Collaborator

knownasilya commented Aug 31, 2017

That post is kinda old 😸 and he even mentions using super at the end, which would require you to use hooks. Plus if you look at code examples or addons from core team members, they always use the hooks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants