This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-12
Channels
- # admin-announcements (3)
- # beginners (17)
- # boot (52)
- # braveandtrue (95)
- # cider (4)
- # cljs-dev (2)
- # clojars (118)
- # clojure (146)
- # clojure-art (4)
- # clojure-austin (1)
- # clojure-finland (20)
- # clojure-italy (33)
- # clojure-nl (1)
- # clojure-russia (49)
- # clojure-spec (136)
- # clojure-uk (28)
- # clojurescript (134)
- # clojutre (1)
- # conf-proposals (64)
- # cursive (3)
- # datomic (76)
- # hoplon (11)
- # ipfs (7)
- # jobs (1)
- # jobs-rus (1)
- # leiningen (4)
- # luminus (4)
- # mount (9)
- # om (34)
- # onyx (34)
- # proton (1)
- # re-frame (4)
- # reagent (35)
- # ring (2)
- # ring-swagger (6)
- # rum (15)
- # untangled (87)
@olegakbarov We occasionally use HoC (Higher Order Components) by just doing this (untested)
(defn greeter
[name]
[:div "Hello: " name])
(defn decorate
[& HoCs]
(into [:div] HoCs))
;; markup:
[decorate [greeter "Spot"] [greeter "Fiddo"]]
Inspect HoC (you are using clj-devtools
I hope)
Got the first version done of my latest Reagent app: http://mtg.arturgajewski.com
@artur nice work. What backend storage to you use?
@gamecubate This is just a front app. The API is mentioned in the About section. This app fetches data from the http://magicthegathering.io API and renders data as needed. Pictures of the Magic cards are loaded from Gatherer.
Working on listing different sets of Magic throughout the years and listing cards belonging to each set.
Upcoming work includes ability to add each card to personal Deck for proxy card printing
Oh I see. Are you using cljs-ajax for the fetches?
Nice.
go is part of core.async IIRC (haven’t used channels yet so not sure)
If so (using async), I am impressed. I’m newish (30 days-) at CLJS so haven’t tackled that beast yet. On the list of TODOs, along with re-frame.
Reagent is great, all things considered.
Hmmm.... is there a way to dispatch secretary one back step? Trying to make a "Go back" button.
@artur: I think you should be able to do something like this - http://www.w3schools.com/jsref/met_his_back.asp
I would just use JS interop to call it directly
Not sure of the exact syntax, check out http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/ for better info than I can give you (I refer to it every time I need to do JS interop, thankfully infrequently for me).
@artur shaun has supplied you with a really good resource, but if you want a shortcut use (.. js/window -history back)
which results in the js
window.history.back()
When you are wrestling this stuff, this can be a useful site:
http://app.klipse.tech/ (takes a while to load)
Enter your cljs
top left, wait for 3 seconds and see the generated js
top right
Nice link thanks Shaun. And thanks Mike for the tip, will try it tomorrow. Now off to bed o/
When using :should-component-update
with a react component that's being used in a JSX application, the first parameter appears to be the old properties. How do I get the changed/updated ones?
Example {:should-component-update (fn [new-props _] (.log js/console new-props))}
shows the new props under the .-props new-props
key, but when I access it that I just have the old prop values.
yrgh, I’m updating a year-old project that has dependencies on reagent, reagent-forms, reagent-utils, and react-bootstrap
what do you mean by "ReactJS incompatibility mess"?
specifically, I just had to bisect my way to a react-bootstrap that works with reagent 0.5.1
Simple solution is just to use stable React version (15.*)
Also, nameToPath sounds like Closure problem instead of React. Maybe missing dependency.