Remove promise handling from skooma.js

This was really just feature creep and doesn't have to be part of
skooma. It could easily be implemented as an independent function or
module.
This commit is contained in:
Talia 2022-04-06 00:40:37 +02:00
parent 6b1eb69ba6
commit fdc7fca7e7
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E

View file

@ -31,12 +31,6 @@ const parseAttribute = (attribute) => {
return JSON.stringify(attribute)
}
const createPromiseNode = promise => {
const comment = document.createComment(`Awaiting ${promise}`)
promise.then(result => {parseArgs(comment.parentNode, comment, result); comment.remove()})
return comment
}
const parseArgs = (element, before, ...args) => {
if (element.content) element = element.content
for (let arg of args) if (arg !== empty)
@ -48,8 +42,6 @@ const parseArgs = (element, before, ...args) => {
arg(element)
else if ("nodeName" in arg)
element.insertBefore(arg, before)
else if (arg.constructor?.name === "Promise")
element.insertBefore(createPromiseNode(arg), before)
else if ("length" in arg)
parseArgs(element, before, ...arg)
else