Skip to content

Commit

Permalink
dom/OnAll: flip [t v] so token is first
Browse files Browse the repository at this point in the history
  • Loading branch information
dustingetz committed Sep 11, 2024
1 parent 03eab83 commit bedd0de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hyperfiddle/electric_dom3.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,10 @@ input's value, use `EventListener`."
(m/ap
(let [!id (atom 0), S (i/spine), !running (atom (sorted-set))]
(m/amb S
(let [v (m/?> flow), id @!id, running (swap! !running conj (swap! !id inc))]
(S id {} [v #(do (swap! !running disj id) (S id {} nil))])
(let [v (m/?> flow), id @!id
running (swap! !running conj (swap! !id inc))
t #(do (swap! !running disj id) (S id {} nil))]
(S id {} [t v])
(run! #(S % {} nil) (take (- (count running) n) ; NOTE Leo: always return 0 or 1 because we add one event at a time
running))
(m/amb)))))))
Expand Down

0 comments on commit bedd0de

Please sign in to comment.