refactor(effect): use includes instead of indexOf (#286)

This commit is contained in:
夜宴 2019-10-15 10:18:26 -05:00 committed by Evan You
parent 1fbb4d22fa
commit 9a37c4b2c3

View File

@ -88,7 +88,7 @@ function run(effect: ReactiveEffect, fn: Function, args: any[]): any {
if (!effect.active) { if (!effect.active) {
return fn(...args) return fn(...args)
} }
if (activeReactiveEffectStack.indexOf(effect) === -1) { if (!activeReactiveEffectStack.includes(effect)) {
cleanup(effect) cleanup(effect)
try { try {
activeReactiveEffectStack.push(effect) activeReactiveEffectStack.push(effect)