Skip to content

Commit

Permalink
qwer
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Oct 25, 2023
1 parent e888f58 commit 1ce784b
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions packages/reactivity/src/reactiveEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ export function track(target: object, type: TrackOpTypes, key: unknown) {
if (!dep) {
depsMap.set(key, (dep = createDep(() => depsMap!.delete(key))))
}
if (__DEV__) {
trackEffect(activeEffect, dep, {
target,
type,
key
})
} else {
trackEffect(activeEffect, dep)
}
trackEffect(
activeEffect,
dep,
__DEV__
? {
target,
type,
key
}
: void 0
)
}
}

Expand Down Expand Up @@ -124,18 +126,20 @@ export function trigger(
pauseScheduling()
for (const dep of deps) {
if (dep) {
if (__DEV__) {
triggerEffects(dep, DirtyLevels.Dirty, {
target,
type,
key,
newValue,
oldValue,
oldTarget
})
} else {
triggerEffects(dep, DirtyLevels.Dirty)
}
triggerEffects(
dep,
DirtyLevels.Dirty,
__DEV__
? {
target,
type,
key,
newValue,
oldValue,
oldTarget
}
: void 0
)
}
}
resetScheduling()
Expand Down

0 comments on commit 1ce784b

Please sign in to comment.