Added Promise.withResolvers pollyfill

This commit is contained in:
BordedDev 2025-03-17 22:05:46 +01:00
parent 287e10d8aa
commit 7fa2817f77
No known key found for this signature in database
GPG Key ID: C5F495EAE56673BF
3 changed files with 13 additions and 2 deletions
src/snek

View File

@ -0,0 +1,8 @@
Promise.withResolvers = Promise.withResolvers || function() {
let resolve, reject;
let promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
return { promise, resolve, reject };
}

View File

@ -6,6 +6,7 @@
<link rel="manifest" href="/manifest.json" />
<title>Snek</title>
<style>{{highlight_styles}}</style>
<script src="/polyfills/Promise.withResolvers.js" type="module"></script>
<!--
<script src="/push.js"></script>
-->

View File

@ -12,7 +12,8 @@
<title>{% block title %}Snek chat by Molodetz{% endblock %}</title>
<script src="/app.js" type="module"></script>
<script src="/polyfills/Promise.withResolvers.js" type="module"></script>
<script src="/app.js" type="module"></script>
<script src="/message-list.js" type="module"></script>
<style>{{ highlight_styles }}</style>
<link rel="stylesheet" href="/style.css">
@ -20,7 +21,8 @@
<script src="/html-frame.js" type="module"></script>
<script src="/generic-form.js" type="module"></script>
<link rel="stylesheet" href="/html-frame.css">
<script defer src="https://umami.molodetz.nl/script.js" data-website-id="d127c3e4-dc70-4041-a1c8-bcc32c2492ea"></script>
<script defer src="https://umami.molodetz.nl/script.js"
data-website-id="d127c3e4-dc70-4041-a1c8-bcc32c2492ea"></script>
{% block head %}
{% endblock %}
</head>