Browse Source

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

夜宴 6 years ago
parent
commit
9a37c4b2c3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/reactivity/src/effect.ts

+ 1 - 1
packages/reactivity/src/effect.ts

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