MCPcopy
hub / github.com/jorgebucaran/hyperapp / createNode

Function createNode

index.js:98–122  ·  view source on GitHub ↗
(vdom, listener, isSvg)

Source from the content-addressed store, hash-verified

96}
97
98var createNode = (vdom, listener, isSvg) => {
99 var props = vdom.props
100 var node =
101 vdom.type === TEXT_NODE
102 ? document.createTextNode(vdom.tag)
103 : (isSvg = isSvg || vdom.tag === "svg")
104 ? document.createElementNS(SVG_NS, vdom.tag, props.is && props)
105 : document.createElement(vdom.tag, props.is && props)
106
107 for (var k in props) {
108 patchProperty(node, k, null, props[k], listener, isSvg)
109 }
110
111 for (var i = 0; i < vdom.children.length; i++) {
112 node.appendChild(
113 createNode(
114 (vdom.children[i] = maybeVNode(vdom.children[i])),
115 listener,
116 isSvg
117 )
118 )
119 }
120
121 return (vdom.node = node)
122}
123
124var patch = (parent, node, oldVNode, newVNode, listener, isSvg) => {
125 if (oldVNode === newVNode) {

Callers 1

patchFunction · 0.85

Calls 2

patchPropertyFunction · 0.85
maybeVNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…