Skip to content

Commit

Permalink
fix(useFsWatcher): invalid watch source warning when ignore options a…
Browse files Browse the repository at this point in the history
…re set to `undefined`, fix #10
  • Loading branch information
KermanX committed Aug 28, 2024
1 parent ac742ce commit 3208709
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/core/src/composables/useFsWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,17 @@ export function useFsWatcher(
}

watch(normalizedPatterns, updateWatchers)
watch([ignoreCreateEvents, ignoreChangeEvents, ignoreDeleteEvents], () => {
clearWatchers()
updateWatchers()
})
watch(
() => [
toValue(ignoreCreateEvents),
toValue(ignoreChangeEvents),
toValue(ignoreDeleteEvents),
],
() => {
clearWatchers()
updateWatchers()
},
)
onScopeDispose(clearWatchers)

return {
Expand Down

0 comments on commit 3208709

Please sign in to comment.