// SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
// For more information, please refer to <https://unlicense.org/>
// SPDX-License-Identifier: Unlicense
var something = 5;
importScripts('worker-library.js');
postMessage("Hello!\n");
addEventListener('message', function(e) {
if (e.data[0] === 'start') {
postMessage("started\n");
something += e.data[1];
setInterval(function() {
something = closure(something);
postMessage("Value: " + something + "\n");
}, 100);
}
});