Added py:all-done event (#1756)

This commit is contained in:
Andrea Giammarchi
2023-09-26 15:56:50 +02:00
committed by GitHub
parent b9a1227e47
commit 3ac2ac0982
11 changed files with 239 additions and 74 deletions

View File

@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../dist/core.css">
<script type="module">
import '../dist/core.js';
document.body.append('loading ...', document.createElement('br'));
addEventListener(
'py:all-done',
() => {
document.body.append('all executed');
},
{ once: true }
);
</script>
</head>
<body>
<script type="py">
print(1)
</script>
<py-script>
print(2)
</py-script>
<py-script async>
print(3)
</py-script>
<script type="py" worker>
print(4)
</script>
<py-script async worker>
print(5)
</py-script>
</body>
</html>