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

Don't use beforeDestroy to affect tracking and progress logging logic #2355

Closed
indirectlylit opened this issue Oct 5, 2017 · 1 comment
Closed
Labels
P2 - normal Priority: Nice to have TAG: tech update / debt Change not visible to user
Milestone

Comments

@indirectlylit
Copy link
Contributor

indirectlylit commented Oct 5, 2017

Vue lifecycle hooks - particularly beforeDestroy - should not be used to trigger application logic.

The vue component lifecycle hooks are tied to the DOM lifecycle, not the application lifecycle. beforeDestroy should only be used for low-level cleanup operations like removing DOM event listeners, clearing timers, and cleaning up callbacks.

Application logic that might currently be triggered by beforeDestroy should instead be triggered by whatever vuex action or state change actually caused the component to be destroyed.


refs:


Some specific things to look for:

  • this.$emit('stopTracking');
  • this.saveAttemptLogMasterLog(false);
  • this.stopTracking();
@indirectlylit indirectlylit changed the title remove all instances of app logic being triggered by beforeDestroy Don't use beforeDestroy to affect tracking and progress logging logic Dec 15, 2017
@rtibbles rtibbles added the P2 - normal Priority: Nice to have label Apr 7, 2021
@jonboiser jonboiser self-assigned this May 11, 2021
@jonboiser jonboiser added this to the 0.15.0 milestone May 20, 2021
@jonboiser jonboiser removed their assignment May 21, 2021
@rtibbles
Copy link
Member

Won't fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 - normal Priority: Nice to have TAG: tech update / debt Change not visible to user
Projects
None yet
Development

No branches or pull requests

3 participants