update examples after making hs2js sync
This commit is contained in:
parent
d132344d11
commit
71f8c0745c
2 changed files with 11 additions and 6 deletions
|
|
@ -1,10 +1,12 @@
|
|||
import { run, parse } from 'hs2js';
|
||||
import { run, parse, loadParser } from 'hs2js';
|
||||
import { initStrudel, reify, late, samples, stack } from '@strudel/web';
|
||||
|
||||
initStrudel({
|
||||
prebake: () => samples('github:tidalcycles/dirt-samples'),
|
||||
});
|
||||
|
||||
const ready = loadParser();
|
||||
|
||||
const textarea = document.getElementById('code');
|
||||
if (window.location.hash) {
|
||||
textarea.value = atob(window.location.hash.slice(1));
|
||||
|
|
@ -50,8 +52,9 @@ const ops = getInfixOperators();
|
|||
|
||||
async function update() {
|
||||
let result, tree;
|
||||
await ready;
|
||||
try {
|
||||
tree = await parse(textarea.value);
|
||||
tree = parse(textarea.value);
|
||||
} catch (err) {
|
||||
console.warn('parse error');
|
||||
console.error(err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue