15 lines
360 B
JavaScript
15 lines
360 B
JavaScript
/** Virtual DOM Node */
|
|
export function VNode(nodeName, attributes, children) {
|
|
/** @type {string|function} */
|
|
this.nodeName = nodeName;
|
|
|
|
/** @type {object<string>|undefined} */
|
|
this.attributes = attributes;
|
|
|
|
/** @type {array<VNode>|undefined} */
|
|
this.children = children;
|
|
|
|
/** Reference to the given key. */
|
|
this.key = attributes && attributes.key;
|
|
}
|