Skip to content

Commit

Permalink
add devtools visibility as suggested in sveltejs/svelte#695
Browse files Browse the repository at this point in the history
  • Loading branch information
ekhaled committed Jan 8, 2018
1 parent 5253b9b commit f9b19dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/hotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ function createProxy (id) {
target.insertBefore(this.__insertionPoint, anchor);
}

this.__insertionPoint.__component__ = this;

anchor = this.__insertionPoint.nextSibling;

if (target.nodeName == '#document-fragment' && insertionPoint) {
Expand All @@ -110,6 +112,8 @@ function createProxy (id) {
proxyComponent.prototype.destroy = function (detach, keepInsertionPoint) {
removeFromMap(this);
if (!keepInsertionPoint) {
//deref for GC before removal of node
this.__insertionPoint.__component__ = null;
var ip = this.__insertionPoint;
ip && ip.parentNode && ip.parentNode.removeChild(ip);
}
Expand Down

0 comments on commit f9b19dc

Please sign in to comment.