Replies: 1 comment 5 replies
-
How about control by flag bits. const flag = ref(true)
const state = ref(0)
const restart = () => (flag.value = true)
watch(state, (v) => {
if (flag) {
// xxx
flag.value = false
}
}) |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Regarding watch-related apis, they all return a stop function uniformly.
How about return a
restart
function to restart watching.like:
Beta Was this translation helpful? Give feedback.
All reactions