Skip to content

Commit

Permalink
chore: use lodash equality in expression field
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaiir committed Apr 8, 2024
1 parent 4f833f4 commit c571d95
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useCallback, useEffect } from 'preact/hooks';
import { useExpressionEvaluation, useDeepCompareMemoize, useService } from '../../hooks';
import { isEqual } from 'lodash';

const type = 'expression';

Expand All @@ -24,7 +25,7 @@ export function ExpressionField(props) {
}, [ field, evaluationMemo, onChange ]);

useEffect(() => {
if (computeOn !== 'change' || evaluationMemo === value) { return; }
if (computeOn !== 'change' || isEqual(evaluationMemo, value)) { return; }
sendValue();
}, [ computeOn, evaluationMemo, sendValue, value ]);

Expand Down

0 comments on commit c571d95

Please sign in to comment.