Navigation Menu

Skip to content

Commit

Permalink
perf(reactivity): optimize effect run condition
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 21, 2022
1 parent 4768f26 commit 25bc654
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/reactivity/src/effect.ts
Expand Up @@ -75,7 +75,7 @@ export class ReactiveEffect<T = any> {
if (!this.active) {
return this.fn()
}
if (!effectStack.includes(this)) {
if (!effectStack.length || !effectStack.includes(this)) {
try {
effectStack.push((activeEffect = this))
enableTracking()
Expand Down

0 comments on commit 25bc654

Please sign in to comment.