Skip to content

Commit

Permalink
chore: minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 20, 2024
1 parent 84033f0 commit f0f2647
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/reactivity/src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ export function watch(
}

let effect: ReactiveEffect
let boundCleanup: typeof onWatcherCleanup
let getter: () => any
let cleanup: (() => void) | undefined
let boundCleanup: typeof onWatcherCleanup
let forceTrigger = false
let isMultiSource = false

Expand Down Expand Up @@ -277,12 +277,12 @@ export function watch(
}

effect = new ReactiveEffect(getter)

effect.scheduler = scheduler
? () => scheduler(job, false)
: (job as EffectScheduler)

boundCleanup = fn => onWatcherCleanup(fn, false, effect)
if (scheduler) {
effect.scheduler = () => scheduler(job, false)
} else {
effect.scheduler = job as EffectScheduler
}

cleanup = effect.onStop = () => {
const cleanups = cleanupMap.get(effect)
Expand Down

0 comments on commit f0f2647

Please sign in to comment.