bigskysoftware / bigskysoftware/_hyperscript
Wait for <x> and <y>
- Langage dominant
- JavaScript
- Étoiles
- 3.8k
- Forks
- 171
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
The `wait` syntax in hyperscript does a great job of enabling event controlled flow. However, it has trouble when waiting on more than one event at the same time. For example:
```
on closeModal(event)
add .closing to #modal
async do
if theURL is not null then
fetch theURL then
put it into #main.innerHTML
end
trigger fetchDone
end
wait for animationend
wait for fetchDone
remove #modal
end
```
This should work if `animationend` finishes before `fetchDone`, but it deadlocks if `fetchDone` completes first.
I think hyperscript would benefit from a `wait for x and y` syntax that is similar to `Promise.all()` that only returns after all of the events have triggered.
This might be generalized to other kinds of operations, such as `wait for any of x and y and z` but my first guess is that this would be less commonly useful.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par localiser la syntaxe `wait` de hyperscript et le flux contrôlé par les événements décrit dans l’issue. Utilisez l’exemple fourni avec `animationend` et `fetchDone` pour examiner le comportement lorsque l’un ou l’autre des événements se produit en premier. C’est terminé lorsqu’une forme `wait for x and y` reprend uniquement après le déclenchement des deux événements, sans se bloquer lorsque leur ordre change.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript
- Domaine
- web-dev
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100