From 33eef619e4a6c71517cbe4b053a7ecb7373cdf6c Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Thu, 2 Nov 2023 22:49:52 +0100 Subject: [PATCH] no destructuring --- packages/codemirror/codemirror.mjs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/codemirror/codemirror.mjs b/packages/codemirror/codemirror.mjs index d05c61a32..0efdd3e55 100644 --- a/packages/codemirror/codemirror.mjs +++ b/packages/codemirror/codemirror.mjs @@ -59,11 +59,10 @@ export class StrudelMirror { if (!onDraw) { return; } - const { scheduler, evaluate } = this.repl; // draw first frame instantly prebaked.then(async () => { - await evaluate(this.code, false); - this.drawer.invalidate(scheduler); + await this.repl.evaluate(this.code, false); + this.drawer.invalidate(this.repl.scheduler); onDraw?.(this.drawer.visibleHaps, 0, []); }); }); @@ -72,9 +71,8 @@ export class StrudelMirror { ...replOptions, onToggle: (started) => { replOptions?.onToggle?.(started); - const { scheduler } = this.repl; if (started) { - this.drawer.start(scheduler); + this.drawer.start(this.repl.scheduler); } else { this.drawer.stop(); } @@ -103,18 +101,15 @@ export class StrudelMirror { }); } async evaluate() { - const { evaluate } = this.repl; this.flash(); - await evaluate(this.code); + await this.repl.evaluate(this.code); } async stop() { - const { scheduler } = this.repl; - scheduler.stop(); + this.repl.scheduler.stop(); } async toggle() { - const { scheduler } = this.repl; - if (scheduler.started) { - scheduler.stop(); + if (this.repl.scheduler.started) { + this.repl.scheduler.stop(); } else { this.evaluate(); }