Skip to content

Commit ea28662

Browse files
authored
Revert cherry eval-cljs-str -> eval-cljs (#720)
Closes #719.
1 parent 5ead17b commit ea28662

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

notebooks/cherry.clj

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,35 +92,33 @@
9292
;; ## 🚦Async/await works cherry
9393

9494
;; Here we dynamically import a module, await its value and then pull out the
95-
;; default function, which we expose as a global function. Because s-expressions
96-
;; serialized to the client currently don't preserve metadata in clerk, and
97-
;; async functions need `^:async`, we use a plain string.
95+
;; default function, which we expose as a global function.
9896

99-
100-
(clerk/eval-cljs-str
101-
"(defn emoji-picker
97+
(clerk/eval-cljs
98+
'(defn emoji-picker
10299
{:async true}
103100
[]
104-
(js/await (js/import \"https://cdn.skypack.dev/emoji-picker-element\"))
101+
(js/await (js/import "https://cdn.skypack.dev/emoji-picker-element"))
105102
(nextjournal.clerk.viewer/html [:div
106-
[:p \"My cool emoji picker:\"]
107-
[:emoji-picker]]))")
103+
[:p "My cool emoji picker:"]
104+
[:emoji-picker]])))
108105

109106
;; In the next block we call it:
110107

111108
(clerk/with-viewer
112109
'(fn [_]
113110
[nextjournal.clerk.render/render-promise
114-
(emoji-picker)]) nil)
111+
(emoji-picker)])
112+
nil)
115113

116114
;; ## 🧩 Macros
117115

118-
(clerk/eval-cljs-str
119-
"(defn clicks []
120-
(reagent.core/with-let [!s (reagent.core/atom 0)]
116+
(clerk/eval-cljs
117+
'(defn clicks []
118+
(reagent.core/with-let [!s (reagent.core/atom 0)]
121119
[:button.bg-teal-500.hover:bg-teal-700.text-white.font-bold.py-2.px-4.rounded.rounded-full.font-sans
122120
{:on-click (fn [] (swap! !s inc))}
123-
\"Clicks: \" @!s]))")
121+
"Clicks: " @!s])))
124122

125123
(clerk/with-viewer '(fn [_] (this-as this [clicks])) nil)
126124

0 commit comments

Comments
 (0)