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(
4343 ) {
4444 const customEqualityFn = j . arrowFunctionExpression (
4545 [ j . identifier ( 'newArgs' ) , j . identifier ( 'lastArgs' ) ] ,
46+ // Exit early if the newArgs and lastArgs are different lengths
4647 j . blockStatement ( [
4748 j . ifStatement (
4849 j . binaryExpression (
@@ -58,9 +59,11 @@ export default function transformer(
5859 ) ,
5960 j . blockStatement ( [ j . returnStatement ( j . booleanLiteral ( false ) ) ] ) ,
6061 ) ,
62+ // create a __equalityFn constant that points to the existing equality function
6163 j . variableDeclaration ( 'const' , [
6264 j . variableDeclarator ( j . identifier ( '__equalityFn' ) , equalityFn ) ,
6365 ] ) ,
66+ // Call the original equalityFn for each argument
6467 j . returnStatement (
6568 j . callExpression (
6669 j . memberExpression (
You can’t perform that action at this time.
0 commit comments