add draw cleanup

This commit is contained in:
Felix Roos 2022-03-11 21:59:24 +01:00
parent 0b206a4d50
commit 1d1d29a163
2 changed files with 12 additions and 0 deletions

View file

@ -39,6 +39,7 @@ Object.assign(globalThis, bootstrapped, Tone, toneHelpers, voicingHelpers, drawH
export const evaluate: any = async (code: string) => {
const shapeshifted = shapeshifter(code); // transform syntactically correct js code to semantically usable code
// console.log('shapeshifted', shapeshifted);
drawHelpers.cleanup();
let evaluated = await eval(shapeshifted);
if (typeof evaluated === 'function') {
evaluated = evaluated();