This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-07
Channels
- # beginners (7)
- # boot (25)
- # clojure (66)
- # clojure-australia (10)
- # clojure-berlin (1)
- # clojure-czech (1)
- # clojure-denmark (2)
- # clojure-france (27)
- # clojure-italy (6)
- # clojure-japan (1)
- # clojure-nl (5)
- # clojure-norway (1)
- # clojure-russia (25)
- # clojurescript (55)
- # cursive (27)
- # datascript (2)
- # datomic (5)
- # editors (4)
- # emacs (2)
- # hoplon (183)
- # ldnclj (45)
- # off-topic (4)
- # om (2)
- # rdf (5)
- # re-frame (11)
- # reagent (5)
- # ring (3)
I would like to write re-frame components where their data requirements are defined as subscriptions that will trigger a fetch (via dispatch) if it misses the cache. Otherwise, return the cached value. In the past I have fought with parameterised subscriptions, so I'm not sure this is a good idea. Has anyone tried this, or thought about it more?
I’ve handled that in the app state. If the app state has any data present for that specific key, then I don’t fetch any data. I do that check in the handler. This is an example, but not sure if it is exactly what you were looking for https://github.com/uris77/clj-aws/blob/master/src%2Fclj_aws%2Fui%2Fasgs%2Fhandlers.cljs#L57
Wouldn’t it be great to have reagent/reframe implemented in cljx so we can easily and performantly run it server side?
@danielcompton: interesting. Sadly, Hiccup is vulnerable to XSS (unless you explicitly escape), so, I’d rather estay away from it. I suppose a compiler from reagent’s template to hiccup could generate code that is not open to XSS.
@pupeno: looks like Reagent’s hiccup a like is ok? https://twitter.com/andershovmoller/status/486834535058124800
danielcompton: reagent’s is k, but hiccup is not.
I’m not sure how that’s relevant to server side rendering though?
danielcompton: that blog post you pointed to is using hiccup on the server side, actual hiccup, not reagent’s.
gotcha, been a while since I read that post
I actually have it working by executing JS on the server… I just don’t like the performance.