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

How create event of destroy component? #48

Closed
ikbc opened this issue Jan 8, 2018 · 2 comments
Closed

How create event of destroy component? #48

ikbc opened this issue Jan 8, 2018 · 2 comments

Comments

@ikbc
Copy link

ikbc commented Jan 8, 2018

I want remove all listeners initialed in controller code if component unmounted, how it's make?
Have any event of life circle of component except 'initialize'?

@sstephenson
Copy link
Contributor

sstephenson commented Jan 8, 2018

You don’t need to remove event listeners declared in data-action attributes—Stimulus takes care of that for you.

If you have other resources to manage, you can set them up in the connect() method of your controller and tear them down in the disconnect() method.

Hope this helps! We’ll have these lifecycle methods documented soon.

@ikbc
Copy link
Author

ikbc commented Jan 9, 2018

It's helps) Thanks!

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

No branches or pull requests

2 participants