Skip to content

Commit

Permalink
trigger error in render fn
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Mar 8, 2022
1 parent b3dac1c commit 0465c74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions notebooks/rule_30.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
(:require [nextjournal.clerk :as clerk]))

(clerk/set-viewers!
[{:pred number? :render-fn '#(v/html [:div.inline-block {:style {:width 16 :height 16}
:class (if (pos? %) "bg-black" "bg-white border-solid border-2 border-black")}])}
[{:pred number? :render-fn '#(do
(js/console.error "o noes, an error")
(v/html [:div.inline-block {:style {:width 16 :height 16}
:class (if (pos? %) "bg-black" "bg-white border-solid border-2 border-black")}]))}
{:pred list? :render-fn '#(v/html (into [:div.flex.flex-col] (v/inspect-children %2) %1))}
{:pred #(and (vector? %) (not (map-entry? %))) :render-fn '#(v/html (into [:div.flex.inline-flex] (v/inspect-children %2) %1))}])

Expand Down

0 comments on commit 0465c74

Please sign in to comment.