-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
component.destroyed #935
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
Comments
Descartes would say - "I am destroyed, therefore I am not" |
@Rich-Harris this was never merged into master, is that an oversight? Would help in eliminating some console warnings in svelte-hot-loader |
sacrosanctic
pushed a commit
to sacrosanctic/svelte
that referenced
this issue
Dec 24, 2024
fix cursor position on state changes - fixes sveltejs#935
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just ran into a case where it would be useful to know, within a component method, whether or not the component still exists (the method runs in a
setTimeout
, which could fire after the component has been destroyed).With knowledge of the internals there are various ways to do this, and you could also do it by setting a custom property inside a
destroy
event handler, but it might be nice if there was a standard, documented way to do it:The text was updated successfully, but these errors were encountered: