bigskysoftware / bigskysoftware/_hyperscript

On variable change events

Aperta
#194 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
JavaScript
Stelle
3.8k
Fork
172
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia esaminando il comportamento esistente delle variabili, degli eventi di modifica e di set a cui fanno riferimento gli esempi. Definisci la semantica prevista e i casi di accettazione per reagire alle modifiche delle variabili e valutare i valori di set; l’issue non indica file né test, quindi è ancora necessario trovare i punti di ingresso dell’implementazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
frontend, web-dev
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.