Skip to content

Commit 5620687

Browse files
committed
Fix showing new taps
1 parent ff404b1 commit 5620687

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/nextjournal/clerk/window.clj

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,24 @@
1717
(v/with-viewer taps-viewer @tap/!taps)))))
1818
([id content] (open! id {} content))
1919
([id opts content]
20+
;; TODO: consider calling v/transform-result
2021
(webserver/update-window! id (merge opts {:nextjournal/presented (update (v/present content) :nextjournal/css-class #(or % ["px-0"]))
2122
:nextjournal/hash (gensym)
2223
:nextjournal/fetch-opts {:blob-id (str id)}
2324
:nextjournal/blob-id (str id)}))))
2425

26+
(add-watch tap/!taps ::tap-watcher (fn [_ _ _ _] (open! ::taps)))
27+
2528
(defn destroy! [id] (webserver/destroy-window! id))
2629

2730
(defn destroy-all! []
2831
(doseq [w (keys @webserver/!windows)]
2932
(destroy! w)))
3033

3134
#_(open! ::taps)
32-
33-
#_(defn tapped [x] (swap! !taps conj x) (open! ::taps))
34-
#_(defonce taps-setup (add-tap tapped))
35-
3635
#_(doseq [f @@(resolve 'clojure.core/tapset)] (remove-tap f))
3736
#_(reset! !taps ())
3837
#_(tap> (range 30))
39-
#_(open! ::taps)
4038
#_(destroy! ::taps)
4139
#_(tap> (v/html [:h1 "Ahoi"]))
4240
#_(tap> (v/table [[1 2] [3 4]]))

0 commit comments

Comments
 (0)