Add onConnect callback to Better

This commit is contained in:
Talia 2021-08-02 22:44:51 +02:00
parent f2f4c03d69
commit 57dacb29c0
No known key found for this signature in database
GPG key ID: AD727AD22802D0D6

View file

@ -51,8 +51,9 @@ export class Better extends HTMLElement {
// Resolves all `connected promises // Resolves all `connected promises
connectedCallback() { connectedCallback() {
this.#connected.forEach( e => e.yes(this) ); if ("onConnec" in this) this.onConnect()
this.#connected = []; this.#connected.forEach( e => e.yes(this) )
this.#connected = []
} }
setContent(...content) { setContent(...content) {