Fixed issues around XWorker context (#1556)

This commit is contained in:
Andrea Giammarchi
2023-06-22 19:04:57 +02:00
committed by GitHub
parent f6dfc5361e
commit 3b7099cd3d
7 changed files with 38 additions and 24 deletions

View File

@@ -8,10 +8,14 @@
<script type="module">
// how would PyScript plugins add their own behavior?
import { hooks } from "@pyscript/element";
let counter = 0;
hooks.onBeforeRun.add((pyodide, { localName }) => {
// console.log(++counter, 'elements so far', localName, pyodide);
});
hooks.codeBeforeRunWorker.add('print("codeBeforeRunWorker")');
hooks.codeAfterRunWorker.add('print("codeAfterRunWorker")');
</script>
</head>
<body>