Let render() create the state rather than vnode()

This commit is contained in:
Pierre-Yves Gerardy 2017-03-08 22:08:16 +01:00
parent 1ffa4cf183
commit 74cbd4c17b
3 changed files with 9 additions and 3 deletions

View file

@ -1,5 +1,5 @@
function Vnode(tag, key, attrs, children, text, dom) {
return {tag: tag, key: key, attrs: attrs, children: children, text: text, dom: dom, domSize: undefined, state: {}, events: undefined, instance: undefined, skip: false}
return {tag: tag, key: key, attrs: attrs, children: children, text: text, dom: dom, domSize: undefined, state: undefined, events: undefined, instance: undefined, skip: false}
}
Vnode.normalize = function(node) {
if (Array.isArray(node)) return Vnode("[", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)