./file.js:
function foo(ctx) { // @export
for (let x of ctx.objs.iterate()) {
x.a = await fetch(ctx, x.b);
}
ctx.ui.btnok.enabled = true;
ctx.commit();
}
autoexport(module, x => eval(x));
And more boilerplate, ceremony and fud down the way, if you go vanilla.(Thank you and all commenters here for sharing your code and experience. In particular, symbol-land looks very interesting and haskell-y.)