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

Avoid resetting state if component is disconnected then immediately reconnected #312

Closed
nolanlawson opened this issue Jan 22, 2023 · 1 comment · Fixed by #313
Closed

Comments

@nolanlawson
Copy link
Owner

I was reading about how Vue implements web components here:

When the element's disconnectedCallback is invoked, Vue will check whether the element is detached from the document after a microtask tick.

  • If the element is still in the document, it's a move and the component instance will be preserved;
  • If the element is detached from the document, it's a removal and the component instance will be unmounted.

This seems really sensible. I think we can do the same thing.

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