Refactor and rename lambda in partial

This commit is contained in:
Sam Nolan 2022-05-02 21:05:59 +00:00
parent 5fc829efc9
commit 0d14216e9f

View File

@ -166,7 +166,7 @@ export let SquigglePartial: React.FC<SquigglePartialProps> = ({
let [expression, setExpression] = React.useState(initialSquiggleString);
let [error, setError] = React.useState<string | null>(null);
React.useEffect(() => {
let runSquiggleAndUpdateBindings = () => {
let squiggleResult = runPartial(
expression,
bindings,
@ -179,7 +179,9 @@ export let SquigglePartial: React.FC<SquigglePartialProps> = ({
} else {
setError(errorValueToString(squiggleResult.value));
}
}, [expression]);
};
React.useEffect(runSquiggleAndUpdateBindings, [expression]);
return (
<div>