syndicate-2017/examples/dom-webworker/worker.js

20 lines
403 B
JavaScript

importScripts("../../dist/syndicate.js");
var G = new Syndicate.WorkerGround(function () {
spawn {
var ui = new Syndicate.UI.Anchor();
field this.counter = 0;
assert ui.html('#counter-holder', '<div><p>The current count is: '+this.counter+'</p></div>')
metalevel 1;
on message 'bump_count'
metalevel 1
{
this.counter++;
}
}
});
G.startStepping();