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:
parent
6b1eb69ba6
commit
fdc7fca7e7
1 changed files with 0 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue