Remove deprecated portal implementation

This commit is contained in:
Andrew Kingston 2020-10-02 20:42:10 +01:00
parent 27c3e6c9e9
commit bfec3327fb
1 changed files with 0 additions and 14 deletions

View File

@ -1,14 +0,0 @@
export function portal(node, targetNodeOrSelector) {
const targetNode =
typeof targetNodeOrSelector == "string"
? document.querySelector(targetNodeOrSelector)
: targetNodeOrSelector
const portalChildren = [...node.children]
targetNode.append(...portalChildren)
return {
destroy() {
for (const portalChild of portalChildren) portalChild.remove()
},
}
}