mastouille.fr est l'un des nombreux serveurs Mastodon indépendants que vous pouvez utiliser pour participer au fédiverse.
Mastouille est une instance Mastodon durable, ouverte, et hébergée en France.

Administré par :

Statistiques du serveur :

594
comptes actifs

#handler

1 message1 participant0 message aujourd’hui

Hier gibt es bis jetzt 33 Links zu örtlichen Fotofachhändler.

swquadrat.de/2025/05/17/linkli

Ich denke da ist noch Luft nach oben. Also schreibt mir (hd-com@gmx.de) welchen Händler ich mit auf die Liste setzen soll.

Für die Reichweite wäre es nett wenn ihr diesen Beitrag teilen würdet, Danke!

SWQUADRAT.DE · Linkliste für Fotofachhändler vor Ort - SWQUADRAT.DEMir ist durch den Kopf gegangen, dass wir auch mal eine Linkliste von unserem Lieblings-Fotoladen erstellen könnten. Also da wo wir persönlich beraten werden und dort auch einkaufen.
En réponse à Thomas Broyer

@tbroyer Ah you're right, I didn't realize the arrow function also inherited the `class` scope as well. Clearly I don't understand how `this` works either!

I'd still argue that needing arrow syntax over method syntax is a problem for the same reason, it shouldn't be necessary to do that.

Also doesn't `this.#handler = this.#handler.bind(this)` still create an instance property? I don't see how that can be avoided here.

Suite du fil

The best pattern I've found for event listeners is effectively:

```javascript
class MyListener {
#handler = (() => {
// Has appropriate `this`.
}).bind(this);

start() {
window.addEventListener('something', this.#handler);
}

stop() {
window.removeEventListener('something', this.#handler);
}
}
```

I really hate that I _have_ to do that. It's incredibly confusing for anyone who doesn't understand `this` (which is most of the community) and creates a new function for each class instance.

Very much looking forward to an `@bound` decorator which does this more ergonomically.