on-connected
a zero-dependency web component that notifies you when connected and disconnected from the DOM
@wessberg/connection-observer
An API that provides a way to asynchronously observe the connectedness of a target Node or querySelector inside a document