Skip to content

Commit

Permalink
fix: use eager watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
aster-mnch committed Jun 15, 2024
1 parent 95b9e90 commit 5dba359
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions content/1.vue/3.reactivity-2/.template/files/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ async function fetchTodo() {
}
}
watch(todoId, fetchTodo)
fetchTodo()
watch(todoId, fetchTodo, { immediate: true })
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion content/1.vue/3.reactivity-2/.template/solutions/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function fetchTodo() {
}
}
watch(() => todoData.id, fetchTodo)
watch(() => todoData.id, fetchTodo, { immediate: true })
fetchTodo()
</script>
Expand Down

0 comments on commit 5dba359

Please sign in to comment.