Merge pull request 'Pollyfill for Promise.withResolvers' () from BordedDev/snek:feat/pollyfill-promise.withResolvers into main

Reviewed-on: https://molodetz.nl/retoor/snek/pulls/31
Reviewed-by: retoor <retoor@noreply@molodetz.nl>
This commit is contained in:
retoor 2025-03-17 21:09:55 +00:00
commit 825ece4e78
3 changed files with 11 additions and 1 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">