MCPcopy
hub / github.com/MithrilJS/mithril.js / createNode

Function createNode

render/render.js:48–61  ·  view source on GitHub ↗
(parent, vnode, hooks, ns, nextSibling)

Source from the content-addressed store, hash-verified

46 }
47 }
48 function createNode(parent, vnode, hooks, ns, nextSibling) {
49 var tag = vnode.tag
50 if (typeof tag === "string") {
51 vnode.state = {}
52 if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)
53 switch (tag) {
54 case "#": createText(parent, vnode, nextSibling); break
55 case "<": createHTML(parent, vnode, ns, nextSibling); break
56 case "[": createFragment(parent, vnode, hooks, ns, nextSibling); break
57 default: createElement(parent, vnode, hooks, ns, nextSibling)
58 }
59 }
60 else createComponent(parent, vnode, hooks, ns, nextSibling)
61 }
62 function createText(parent, vnode, nextSibling) {
63 vnode.dom = $doc.createTextNode(vnode.children)
64 insertNode(parent, vnode.dom, nextSibling)

Callers 5

createNodesFunction · 0.70
createComponentFunction · 0.70
updateNodesFunction · 0.70
updateNodeFunction · 0.70
updateComponentFunction · 0.70

Calls 6

initLifecycleFunction · 0.70
createTextFunction · 0.70
createHTMLFunction · 0.70
createFragmentFunction · 0.70
createElementFunction · 0.70
createComponentFunction · 0.70

Tested by

no test coverage detected