Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added function tap-current-value to inspector #167

Merged
merged 8 commits into from
Mar 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/orchard/inspect.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
(java.lang.reflect Constructor Field Method Modifier)
(java.util List Map)))

;; Datafy and Nav are only available since Clojure 1.10
;; Datafy Nav and tap> are only available since Clojure 1.10
(require 'clojure.core.protocols)

(def ^:private datafy
Expand All @@ -25,6 +25,8 @@
(def ^:private nav
(misc/call-when-resolved 'clojure.core.protocols/nav))

(def ^:private maybe-tap>
(misc/call-when-resolved 'clojure.core/tap>))
;;
;; Navigating Inspector State
;;
Expand Down Expand Up @@ -174,7 +176,7 @@
(defn tap-current-value
"Tap the currently inspected value."
[inspector]
(tap> (:value inspector))
(maybe-tap> (:value inspector))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it a noop on older Clojure

(inspect-render inspector))

(declare inspector-value-string)
Expand Down