RFC: Expose a qCleanup
event when component is unmounted
#219
Labels
[STAGE-2] incomplete implementation
Remove this label when implementation is complete
[STAGE-2] not fully covered by tests yet
Remove this label when tests are verified to cover the implementation
[STAGE-2] unresolved discussions left
Remove this label when all critical discussions are resolved on the issue
[STAGE-3] docs changes not added yet
Remove this label when the necessary documentation for the feature / change is added
[STAGE-3] missing 2 reviews for RFC PRs
Remove this label when at least 2 core team members reviewed and approved the RFC implementation
Champion
@GrandSchtroumpf
What's the motivation for this proposal?
Problems you are trying to solve:
document
,window
orHTMLElement
without downloading core.useOn
.Goals you are trying to achieve:
Wrap Browser based event emitter, without downloading core right away.
Examples:
Any other context or information you want to share:
useOn
is the best place to achieve that, but it doesn't cleanup, so we need a way to know when the component is unmounted to cleanup.Proposed Solution / Feature
What do you propose?
Emit a new CustomEvent before the component unmount.
Code examples
The goal here is to
Additional information
The
qCleanup
event should not impact the rendering process (shouldn't wait for the callbacks to fullfil)In an ideal world the element should be still in the DOM when the event is received. But it's not mandatory for this RFC:
Another usage of this event would be to run ViewTransition on leaving element (But it would only work if the el is still in the DOM at this moment...)
PRs/ Links / References
No response
The text was updated successfully, but these errors were encountered: