bigskysoftware / bigskysoftware/_hyperscript
Wait for <x> and <y>
- 主要言語
- JavaScript
- スター
- 3.8k
- フォーク
- 172
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まず、hyperscript の `wait` 構文と、issue で説明されているイベント制御フローを見つけます。提供されている `animationend` と `fetchDone` の例を使って、どちらかのイベントが先に発生した場合の動作を調べます。完了の条件は、`wait for x and y` 形式が両方のイベントが発生した後にのみ再開し、イベントの順序が変わってもデッドロックしないことです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- web-dev
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100