diff --git a/docs/dist/App.js b/docs/dist/App.js index 86d580ab..98d2a884 100644 --- a/docs/dist/App.js +++ b/docs/dist/App.js @@ -43,9 +43,7 @@ function App() { return []; } }, [pattern]), - onSchedule: useCallback((_events, cycle2) => { - logCycle(_events, cycle2); - }, [pattern]), + onSchedule: useCallback((_events, cycle2) => logCycle(_events, cycle2), [pattern]), ready: !!pattern }); useEffect(() => { @@ -57,8 +55,12 @@ function App() { } catch (err) { setMode("javascript"); _pattern = parse(code); + if (_pattern?.constructor?.name !== "Pattern") { + const message = `got "${typeof _pattern}" instead of pattern`; + throw new Error(message + (typeof _pattern === "function" ? "did you foget to call a function?" : "")); + } } - setPattern(_pattern); + setPattern(() => _pattern); setError(void 0); } catch (err) { console.warn(err); diff --git a/docs/dist/logo.svg.proxy.js b/docs/dist/logo.svg.proxy.js index 73f6fe7f..aed9da04 100644 --- a/docs/dist/logo.svg.proxy.js +++ b/docs/dist/logo.svg.proxy.js @@ -1 +1 @@ -export default "/strudel/dist/logo.svg"; \ No newline at end of file +export default "/dist/logo.svg"; \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 507724ce..0e7db17b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,8 +2,8 @@ - - + + Strudel REPL @@ -11,6 +11,6 @@
- +