Skip to content

Commit

Permalink
Update debug docs
Browse files Browse the repository at this point in the history
  • Loading branch information
superstructor committed Feb 24, 2021
1 parent 51a0d66 commit a77306e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/re_com/validate.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(ns re-com.validate)

(defmacro validate-args-macro
"if goog.DEBUG is true then validate the args, otherwise replace the validation code with true
for production builds which the {:pre ...} will be happy with"
"if goog.DEBUG is true then validate the args, otherwise replace the validation code with nil"
[args-desc args]
`(if-not ~(vary-meta 'js/goog.DEBUG assoc :tag 'boolean)
nil
Expand Down
4 changes: 2 additions & 2 deletions src/re_demo/debug.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@
" The two should be combined like this:"]
[:pre
"[button\n :src (at) ;; <-- note\n :label \"click me\"\n ...]"]
[p "To use it, your " [:code "ns"] " will need to " [:code ":require-macros"] " it as follows:"]
[p "To use it, your " [:code "ns"] " will need to " [:code ":require"] " it as follows:"]
[:pre
"(ns my.app\n (:require-macros\n [re-com.core :refer [at]]) ;; <-- note\n (:require\n [re-com.core :refer [h-box v-box ...]])"]
"(ns my.app\n (:require\n [re-com.core :refer [at h-box v-box ...]])) ;; <-- note 'at'"]
[p "But wait, you get more. "]
[p "When " [:code ":src"] " is provided, re-com will add a \"data\" attribute to the DOM "
"node representing a component. This attribute, called " [:code "data-rc-src"] ", will contain any source code coordinates provided. "]
Expand Down

0 comments on commit a77306e

Please sign in to comment.