fix: stop other repls on start

This commit is contained in:
Felix Roos 2023-12-25 15:21:54 +01:00
parent ed8f5bf24f
commit e8e8f888dd
2 changed files with 29 additions and 1 deletions

View file

@ -34,6 +34,7 @@ export function MicroRepl({
}
const editor = new StrudelMirror({
id,
defaultOutput: webaudioOutput,
getTime: () => getAudioContext().currentTime,
transpiler,
@ -76,6 +77,9 @@ export function MicroRepl({
init({ code, shouldDraw });
});
}
return () => {
editor.clear();
};
}, []);
if (!client) {