Skip to content

Commit

Permalink
tutorial: transfer from browser repl: upgrade the tutorial, but cljs …
Browse files Browse the repository at this point in the history
…repl still busted
  • Loading branch information
dustingetz committed Feb 16, 2023
1 parent 2446937 commit d413e22
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src-docs/user/electric/electric_2_transfer.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
(hyperfiddle.rcf/enable!)

(e/defn App [x]
(if (even? x)
(pr-str (type 1))
~@(pr-str (type 1)))) ; client/server transfer
(e/client
(if (even? x)
(pr-str (type 1))
(e/server (pr-str (type 1)))))) ; client/server transfer

#?(:cljs
(tests
"client/server transfer, pure functional!"
(def !x (atom 0))
(def dispose ((e/boot (try (tap (App. (e/watch !x)))
(catch Pending _)))
(def dispose ((e/boot (tap (new App (e/watch !x))))
js/console.log js/console.error))
% := "#object[Number]"
(swap! !x inc)
Expand Down

0 comments on commit d413e22

Please sign in to comment.