This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-23
Channels
- # bangalore-clj (5)
- # beginners (136)
- # boot (1)
- # bristol-clojurians (6)
- # cider (46)
- # cljs-dev (172)
- # cljsrn (35)
- # clojure (82)
- # clojure-china (2)
- # clojure-dev (9)
- # clojure-dusseldorf (1)
- # clojure-finland (15)
- # clojure-italy (54)
- # clojure-norway (4)
- # clojure-russia (6)
- # clojure-spec (19)
- # clojure-uk (61)
- # clojurebridge (1)
- # clojurescript (55)
- # community-development (23)
- # cursive (7)
- # datomic (19)
- # emacs (10)
- # events (4)
- # fulcro (108)
- # graphql (7)
- # hoplon (1)
- # leiningen (7)
- # lumo (14)
- # off-topic (68)
- # onyx (23)
- # parinfer (8)
- # portkey (40)
- # precept (11)
- # re-frame (5)
- # reagent (40)
- # ring-swagger (5)
- # shadow-cljs (58)
- # specter (5)
- # tools-deps (37)
- # unrepl (13)
- # vim (9)
- # yada (12)
Is there a template using nodejs ( machchiato ) and re-frame that i can use? Or any suggestion to do this?
or reagent and machchiato
Dear Reagent friends. I tried r/with-let
thinking it would write the equivalent form-2 component for me as in this gist:
https://gist.github.com/borkdude/8940696b87f22e40a4ccc402066fce68
But the form-2 component doesn’t print “MOUNT” every time I change the selection in the dropdown. The r/with-let
one does, so that doesn’t work for me as re-inits the state every time. What’s the explanation?
Any easy way to get reagent to use react 16? I really want custom attributes for a css library
There is this branch: https://github.com/reagent-project/reagent/tree/react-16
I’m not sure how to include that as a dependency in my project.clj though
Latest alpha is compatible, that branch just changes the default.
@caleb.macdonaldblack Just add those updated cljsjs
deps to your own project.
Oh cool thanks!
(defonce app-state
(reagent/atom {:example1 {:counter 0}
:example2 {:counter 0}}))
;; will print every time you rerender
(defn example1 []
(reagent/with-let [example1-cursor (reagent/cursor app-state [:example1])]
(js/console.log "example1 is rendering")
[:div
[:button {:on-click #(swap! example1-cursor update :counter inc)}
"Increment"]
[:h1 (str "The current count is: " (:counter @example1-cursor))]
]))
;; will print once
(defn example2 []
(reagent/with-let [example2-cursor (reagent/cursor app-state [:example2])
_ (js/console.log "example2 is rendering")]
[:div
[:button {:on-click #(swap! example2-cursor update :counter inc)}
"Increment"]
[:h1 (str "The current count is: " (:counter @example2-cursor))]
]))
(defn page [ratom]
[:div
[example1]
[example2]
])
@borkdude I’m looking for the a-ha moment… what was missing?
actually it’s probably worth putting into the docs because it’s a very succinct explanation
i learned most of reagent’s oddities by sticking print statements in various portions of components
I learned most of what I know about programming by sticking print statements in various pieces of code
oh ok, I see
@pesterhazy We have now entered the post-println world (warning, some hyperbole). re-frame-10x
now has form level trace of your lisp. (about to be released). End of advertisement.
@mikethompson you mean like a debugger?
Remember LightTable? Better than that. (WIP)
So not so much a debugger, although useful for debugging
More soon.
you’re really going to make me learn the difference between an inteceptor and an coeffect arn’t you 🙂
I’m at the edge of my seat @mikethompson
My hyperbole is working !!!
google for define: hyperbole
. Click the speaker button to hear it said, because the pronunciation will not be what you think :-)
@pesterhazy with source map you can use Chrome's DebugTools: (js* "debugger;")
@mikethompson ever heard of Plato? Aristotle? Socrates? Morons....