Example for stopping Composition API watcher seems odd #2236
-
I wanted to ask first, because maybe it is just me not understanding it, but I can't get into this sample code for stopping a watcher in Composition API: Either I don't need to instantiate |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I don't understand the question. |
Beta Was this translation helpful? Give feedback.
I don't understand the question.
unwatch
is a function, you invoke it usingunwatch()
. The nameunwatch
is arbitrary, as it's just a local variable name being used to hold the function returned bywatchEffect
. I'm not sure why you think it's weird or unclear.