This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-11
Channels
- # aws (6)
- # beginners (167)
- # cider (41)
- # cljs-dev (6)
- # cljsrn (3)
- # clojure (399)
- # clojure-dusseldorf (1)
- # clojure-nl (2)
- # clojure-spec (3)
- # clojure-uk (47)
- # clojurescript (16)
- # core-async (8)
- # cursive (56)
- # datomic (14)
- # devcards (1)
- # docs (2)
- # duct (2)
- # editors (3)
- # emacs (3)
- # fulcro (178)
- # graphql (10)
- # off-topic (107)
- # onyx (7)
- # pedestal (21)
- # planck (13)
- # re-frame (58)
- # reagent (76)
- # ring-swagger (3)
- # shadow-cljs (85)
- # slack-help (2)
- # sql (1)
- # tools-deps (11)
- # uncomplicate (5)
- # vim (24)
- # yada (4)
Anyone can get aws-amplify
to :require
? https://stackoverflow.com/questions/49767358/aws-amplify-with-clojurescript
when writing a plain webapp in cljs using hiccup templating, who uses which library (`weavejester/hiccup`, teropa/hiccup
, ...?) and why?
I found for my project convenient library that can combine hiccup syntax and “I don’t want to use react in any form” - http://documentup.com/aaronc/freactive
oh yeah, I remember that from last year... not much seems to have moved since than. But I'll check it again! Thx.
seems nobody is using cljs with plain non-react-wrapper hiccups?
@kurt-o-sys I do not use non-react-wrapper hiccups with cljs, but you can check macchiato framework by yogthos. This is official example application which uses macchiato/hiccups . https://github.com/macchiato-framework/examples/blob/master/guestbook/src/guestbook/routes.cljs Hope it will help you. 🙏
ok, thx... macchiato includes backend (and seems to have focus on interaction between front and back end). But it uses weavejester/hiccup
, that answers my question. So far the score is:
weavejester/hiccup
: 1
teropa/hiccup
: 0
🙂
Hello all. I’m trying to write a function/macro that accomplishes the following.
(defn my-func [state]
(fn [] {:hello state}))
(defn test []
(with-state "world" [my-func]
(fn []
(my-func)))) ;; Returns {:hello "world"}
My current function looks something like:
(defn with-state [state functions body]
(doseq [f functions]
(intern *ns* ??? (f state)))
body)
but I can’t figure out how to override the function that is passed in. Anyone have ideas?I’m not sure what exactly you want to do. But you must realize that under normal circumstances clojurescript macros are clojure code. So calling intern in clojure will create a var in clojure, not in clojurescript.
Basically I want to get around having to do this:
(defn test [state]
(let [my-func1 (my-func1 state)
my-func1 (my-func2 state)
my-func3 (my-func3 state)]
you should def the state beforehand by hand and pass symbol name into the macro as a first param
you can make it part of the macro-generated code, but I don’t think it is a good practice to bake defs into macros (without them clearly being named defsomething)