Skip to content

Commit

Permalink
refactor: reduce redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed May 31, 2023
1 parent 8ad1d99 commit 4e603d7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,6 @@ export const watch: WatchOverloads = <
): WatchStopHandle => {
let deep = options?.deep ?? false;
const immediate = options?.immediate ?? false;
const onTrack = options?.onTrack ?? undefined;
const onTrigger = options?.onTrigger ?? undefined;
const onStop = options?.onStop ?? undefined;

let getter: () => any;
let isMultiSource = false;
Expand Down Expand Up @@ -498,9 +495,9 @@ export const watch: WatchOverloads = <
effect = internalEffect(getter, {
scheduler: job,
allowRecurse: true,
onTrack,
onTrigger,
onStop,
onTrack: options?.onTrack,
onTrigger: options?.onTrigger,
onStop: options?.onStop,
});
if (immediate) {
job();
Expand Down

0 comments on commit 4e603d7

Please sign in to comment.