I frequently write stuff like this:
(defn some-fn [arg1 arg2]
...
(tap> {:in `some-fn :arg1 arg1 :arg2 arg2 :some-local-val some-local-val})
...
Is there some helper that'd just let me say:
(mytap> ['arg1 'arg2 'some-local-val])?I recently tried https://github.com/beoliver/wiretap to log arguments and return values of functions, doesn't tap local values though
There are several macros like https://github.com/worldsingles/commons/blob/master/src/ws/clojure/extensions.clj#L152 that produce a hash map of all locals (incl. arguments) so (tap> (ws/local-map)) might be an option?
Is there any way to inject a <style> tag in portal hiccup viewer for previewing components that have external styles?
That is what I intuitively tried first. What threw me off was that, subsequent taps, rendering hiccup to the portal window, would not override previously rendered css. Ex. If I rendered green text on the first tap, then it would not change on subsequent taps. But I see now that If i p/clear , then I get a fresh css context.
Now using some config you provided me before, to only show the last result in the window. This fulfills my goal to preview html + non-inline css!
(def last-tap (atom nil))
(defn clear-submit [value]
(reset! last-tap value))
(p/inspect last-tap {:launcher :vs-code})
(add-tap (var clear-submit))Any insight into why the normal tap results are not isolated?, I thought each would be it’s own “webview”.
was asked here. but couln’t find anything else. https://clojurians.slack.com/archives/C0185BFLLSE/p1661027933535839
Currently, the easiest way is to include the styles in a style tag in the hiccup itself:
[:<> [:style ...] [:div ...]]I am open to alternatives if you have some ideas 👌