1
0
Fork 0
mirror of synced 2024-09-30 00:57:16 +13:00

Remove deprecated portal implementation

This commit is contained in:
Andrew Kingston 2020-10-02 20:42:10 +01:00
parent d1512f202b
commit cf9d261192

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()
},
}
}