Refactor and rename lambda in partial
This commit is contained in:
parent
5fc829efc9
commit
0d14216e9f
|
@ -166,7 +166,7 @@ export let SquigglePartial: React.FC<SquigglePartialProps> = ({
|
||||||
let [expression, setExpression] = React.useState(initialSquiggleString);
|
let [expression, setExpression] = React.useState(initialSquiggleString);
|
||||||
let [error, setError] = React.useState<string | null>(null);
|
let [error, setError] = React.useState<string | null>(null);
|
||||||
|
|
||||||
React.useEffect(() => {
|
let runSquiggleAndUpdateBindings = () => {
|
||||||
let squiggleResult = runPartial(
|
let squiggleResult = runPartial(
|
||||||
expression,
|
expression,
|
||||||
bindings,
|
bindings,
|
||||||
|
@ -179,7 +179,9 @@ export let SquigglePartial: React.FC<SquigglePartialProps> = ({
|
||||||
} else {
|
} else {
|
||||||
setError(errorValueToString(squiggleResult.value));
|
setError(errorValueToString(squiggleResult.value));
|
||||||
}
|
}
|
||||||
}, [expression]);
|
};
|
||||||
|
|
||||||
|
React.useEffect(runSquiggleAndUpdateBindings, [expression]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user