Skip to content

Commit

Permalink
fix(taro): hooks deps 改变没有处理空数组的情况,#2995
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed May 9, 2019
1 parent 81d8c5d commit c96975d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/taro/src/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,7 @@ function areDepsChanged (prevDeps, deps) {
if (isNullOrUndef(prevDeps) || isNullOrUndef(deps)) {
return true
}
for (let i = 0; i < deps.length; i += 1) {
const val1 = deps[i]
const val2 = prevDeps[i]
if (is(val1, val2)) {
continue
}
return false
}
return true
return deps.some((d, i) => !is(d, prevDeps[i]))
}

export function invokeEffects (component, delay) {
Expand Down

0 comments on commit c96975d

Please sign in to comment.