You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
tonull
(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.The text was updated successfully, but these errors were encountered: