perf(reactivity): optimize effect run condition

This commit is contained in:
Evan You 2022-01-21 09:41:54 +08:00
parent 4768f26f59
commit 25bc6549eb

View File

@ -75,7 +75,7 @@ export class ReactiveEffect<T = any> {
if (!this.active) { if (!this.active) {
return this.fn() return this.fn()
} }
if (!effectStack.includes(this)) { if (!effectStack.length || !effectStack.includes(this)) {
try { try {
effectStack.push((activeEffect = this)) effectStack.push((activeEffect = this))
enableTracking() enableTracking()