Skip to content

Conversation

johnsimons
Copy link
Member

Small improvement, it seems using a watcher is a better way to clearing previous timeouts

Ensures that only one timeout is active for hiding the "copied" tooltip, preventing potential issues when copying multiple times in quick succession.

This is achieved by clearing any existing timeout before setting a new one.
@johnsimons johnsimons self-assigned this Apr 4, 2025
@johnsimons johnsimons requested a review from PhilBastian April 4, 2025 07:25
@PhilBastian
Copy link
Contributor

where did you source this best practice from? Connect the dots for future reviewers

@johnsimons
Copy link
Member Author

johnsimons commented Apr 7, 2025

This came mostly from reading the docs about side effects - https://vuejs.org/guide/essentials/watchers.html#side-effect-cleanup

@johnsimons johnsimons merged commit bf10b6f into master Apr 7, 2025
5 checks passed
@johnsimons johnsimons deleted the john/improve-cleartimeout branch April 7, 2025 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants