bigskysoftware / bigskysoftware/_hyperscript

On variable change events

Offen
#194 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
JavaScript
Sterne
3.8k
Forks
172
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hej, still loving the good work! I had an idea which I want to bounce here: acting on variable changes (reactivity)

**Motivation**

Having the ability to react to variable changes reduces the need for extra vanilla js or 3rd party libs, like alpinejs.

**POC Setup**

I have a table of products, they all have an unique id, I want to be able to select a subset of the products and update a link somewhere reflecting the selection.

**Code example**

I am not 100% sure on code correctness but I hope the idea is clear. Also, toggle would make more sense than just add but I wanted to use `append` just as it's there ...

```

...
... ...
...

```
And then somewhere else I would put
```
link
```
Alternative example would be
```

No products selected

```

**Questions**

This boils down to two questions I guess:
1. does it make sense for hyperscript to handle such change events
2. can the `set` sommand handle arbitrary js code to execute as the attribute value (having js code there would probably make most sense, one could get away by having something else)?

**Summary**

It's just an idea but if present would completely eliminate the need of something else that can handle reactivity, and ... the moral dilemma is, if I need to pull in another thing, why have two dependencies then.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit der Überprüfung des bestehenden Verhaltens von Variablen, Änderungsereignissen und set, auf das in den Beispielen verwiesen wird. Definiere die beabsichtigte Semantik und die Akzeptanzfälle für die Reaktion auf Variablenänderungen und die Auswertung von set-Werten; im Issue werden keine Dateien oder Tests genannt, daher müssen die Einstiegspunkte für die Implementierung noch gefunden werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
frontend, web-dev
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.