Skip to content

Do watcher's created in composables need to have their unwatch function invoked? #7633

Closed Answered by posva
ehainer asked this question in Help/Questions
Discussion options

You must be logged in to vote

Kind of assuming that as long as the watcher is not created asyncronously the same rules apply and yes the watcher will be stopped automatically. Just in the pursuit of a definitive clear answer.

Yes, that's correct. It's as if the watch() was invoked where you called your composable, so it gets destroyed automatically, no need to add an onUnmounted()

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@posva
Comment options

posva Oct 19, 2023
Collaborator

Comment options

You must be logged in to vote
0 replies
Answer selected by posva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants