File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export default function transformer(
43
43
) {
44
44
const customEqualityFn = j . arrowFunctionExpression (
45
45
[ j . identifier ( 'newArgs' ) , j . identifier ( 'lastArgs' ) ] ,
46
+ // Exit early if the newArgs and lastArgs are different lengths
46
47
j . blockStatement ( [
47
48
j . ifStatement (
48
49
j . binaryExpression (
@@ -58,9 +59,11 @@ export default function transformer(
58
59
) ,
59
60
j . blockStatement ( [ j . returnStatement ( j . booleanLiteral ( false ) ) ] ) ,
60
61
) ,
62
+ // create a __equalityFn constant that points to the existing equality function
61
63
j . variableDeclaration ( 'const' , [
62
64
j . variableDeclarator ( j . identifier ( '__equalityFn' ) , equalityFn ) ,
63
65
] ) ,
66
+ // Call the original equalityFn for each argument
64
67
j . returnStatement (
65
68
j . callExpression (
66
69
j . memberExpression (
You can’t perform that action at this time.
0 commit comments