Skip to content

Commit

Permalink
fix(hdom): delay init() lifecycle call to ensure children are available
Browse files Browse the repository at this point in the history
- update diffElement()
  • Loading branch information
postspectacular committed May 15, 2018
1 parent 81b596f commit 2482b16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/hdom/src/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ function _diffElement(parent: Element, prev: any, curr: any, child: number) {
if ((i = prev.__release) && i !== curr.__release) {
releaseDeep(prev);
}
if ((i = curr.__init) && i != prev.__init) {
// DEBUG && console.log("call __init", curr);
i.apply(curr, [el, ...(curr.__args)]);
}
if (edits[1][0] !== 0) {
diffAttributes(el, prev[1], curr[1]);
}
Expand Down Expand Up @@ -109,6 +105,10 @@ function _diffElement(parent: Element, prev: any, curr: any, child: number) {
}
}
}
if ((i = curr.__init) && i != prev.__init) {
// DEBUG && console.log("call __init", curr);
i.apply(curr, [el, ...(curr.__args)]);
}
}

function releaseDeep(tag: any) {
Expand Down

0 comments on commit 2482b16

Please sign in to comment.