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

refactor: use @vueuse/core useEventListener composable in order to remove listeners easier #1201

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sadeghbarati
Copy link
Collaborator

@sadeghbarati sadeghbarati commented Aug 8, 2024

Close #1182

Feel free to change the commit message when you want to squash it 😬


Vue Playground for showing useEventListener removing events correctly when the component is unmounted or compostables scopes disposed

To test this playground, Move useEventListener inside watchEffect with if or inside forEach or inside bruh function xd

@sadeghbarati
Copy link
Collaborator Author

sadeghbarati commented Aug 8, 2024

Only these files use the native addEventListener function, which I'm not sure how to use useEventListener composable there, please check them out and give me a tip, thanks.

image

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.

[Feature]: Replace addEventListener with useEventListener composable
2 participants