fix: test
This commit is contained in:
parent
cea33783a2
commit
0baa8383f2
1 changed files with 11 additions and 9 deletions
|
|
@ -227,15 +227,17 @@ const processMessage = (message) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.onconnect = function (e) {
|
if (typeof self !== 'undefined') {
|
||||||
// the incoming port
|
self.onconnect = function (e) {
|
||||||
const port = e.ports[0];
|
// the incoming port
|
||||||
allPorts.push(port);
|
const port = e.ports[0];
|
||||||
port.addEventListener('message', function (e) {
|
allPorts.push(port);
|
||||||
processMessage(e.data);
|
port.addEventListener('message', function (e) {
|
||||||
});
|
processMessage(e.data);
|
||||||
port.start(); // Required when using addEventListener. Otherwise called implicitly by onmessage setter.
|
});
|
||||||
};
|
port.start(); // Required when using addEventListener. Otherwise called implicitly by onmessage setter.
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function createClock(
|
function createClock(
|
||||||
callback, // called slightly before each cycle
|
callback, // called slightly before each cycle
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue