Add support for initialisation function to skooma
This commit is contained in:
parent
12edc1890e
commit
95c6540ba2
1 changed files with 2 additions and 0 deletions
|
@ -40,6 +40,8 @@ const parseArgs = (element, before, ...args) => {
|
||||||
for (let arg of args)
|
for (let arg of args)
|
||||||
if (typeof arg == "string" || typeof arg == "number")
|
if (typeof arg == "string" || typeof arg == "number")
|
||||||
element.insertBefore(document.createTextNode(arg), before)
|
element.insertBefore(document.createTextNode(arg), before)
|
||||||
|
else if (typeof arg == "function")
|
||||||
|
arg(element)
|
||||||
else if ("nodeName" in arg)
|
else if ("nodeName" in arg)
|
||||||
element.insertBefore(arg, before)
|
element.insertBefore(arg, before)
|
||||||
else if (arg.constructor?.name === "Promise")
|
else if (arg.constructor?.name === "Promise")
|
||||||
|
|
Loading…
Reference in a new issue