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

Teardown should dissociate the component from its node #348

Open
Mr0grog opened this issue May 13, 2015 · 0 comments
Open

Teardown should dissociate the component from its node #348

Mr0grog opened this issue May 13, 2015 · 0 comments

Comments

@Mr0grog
Copy link

Mr0grog commented May 13, 2015

While writing some tests, I noticed that flight components can still fire off events or take other actions on their node after they're town down, which seems like something that shouldn't be possible.

In my particular case, a component had an in-flight XHR that completed after the end of the test and wound up affecting the next test (even though I'm careful to tear down all components after each test). I fully understand that a well-behaved component should keep track of all its timers/xhrs/callbacks and clean them up before/after teardown is called, but I also think this is something that people could easily forget to do.

Explicitly setting node and $node to null (or perhaps setting them to a new DOM element that isn't in the document) would go pretty far towards neutering a component's ability to accidentally do things after teardown.

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

1 participant