animate mvp

This commit is contained in:
Felix Roos 2022-12-31 16:23:45 +01:00
parent 83ca8d95be
commit 0caedeb481
3 changed files with 52 additions and 1 deletions

View file

@ -3,6 +3,10 @@ import { evaluate as _evaluate } from './evaluate.mjs';
import { logger } from './logger.mjs';
import { setTime } from './time.mjs';
export let scheduler; // expose scheduler to global scope
// this is not optimal as it will only work for one repl at a time
// TODO: use pattern.context to expose scheduler
export function repl({
interval,
defaultOutput,
@ -14,7 +18,7 @@ export function repl({
transpiler,
onToggle,
}) {
const scheduler = new Cyclist({
scheduler = new Cyclist({
interval,
onTrigger: async (hap, deadline, duration) => {
try {