call an exported start function if it exists

This commit is contained in:
2023-01-28 12:31:16 +01:00
committed by denni
parent 4a4beded11
commit 8a473cc9b9
4 changed files with 14 additions and 1 deletions

View File

@@ -263,6 +263,10 @@ export default function MicroW8(screen, config = {}) {
window.addEventListener('blur', () => updateVisibility(false), { signal: abortController.signal });
updateVisibility(document.hasFocus());
if (instance.exports.start) {
instance.exports.start();
}
function mainloop() {
if (!keepRunning) {
return;