-
-
Save yolio2003/be9d989ca49a1c918c1b7b7366b7c46e to your computer and use it in GitHub Desktop.
natto.dev eval pseudocode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const f = useMemo(() => { | |
try { | |
return new Function('inputs', `return ${expression}`); | |
} catch (e) { | |
return [e]; | |
} | |
}, [expresssion]); | |
// input atoms | |
useEffect(() => { | |
try { | |
setOutput(f(inputs)); | |
} catch {} | |
}, [inputs]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment