re-frame

Why are there clj and cljs folders in my lein re-frame template?

倖福魔咒の 提交于 2021-02-10 12:15:50
问题 Why are there clj and cljs folders in my lein re-frame template as below? And why do they both include files called .core that appear to use the same namespaces? I've been told this is the place to start when learning re-frame, but I cannot find any explanations of why the templates are setup the way they are or created including the content they include. There is no explanation for any of the boilerplate or code that comes with any lein template which make them very hard to use for beginners

Why are there clj and cljs folders in my lein re-frame template?

一笑奈何 提交于 2021-02-10 12:14:21
问题 Why are there clj and cljs folders in my lein re-frame template as below? And why do they both include files called .core that appear to use the same namespaces? I've been told this is the place to start when learning re-frame, but I cannot find any explanations of why the templates are setup the way they are or created including the content they include. There is no explanation for any of the boilerplate or code that comes with any lein template which make them very hard to use for beginners

Why are there clj and cljs folders in my lein re-frame template?

瘦欲@ 提交于 2021-02-10 12:13:26
问题 Why are there clj and cljs folders in my lein re-frame template as below? And why do they both include files called .core that appear to use the same namespaces? I've been told this is the place to start when learning re-frame, but I cannot find any explanations of why the templates are setup the way they are or created including the content they include. There is no explanation for any of the boilerplate or code that comes with any lein template which make them very hard to use for beginners

Why are there clj and cljs folders in my lein re-frame template?

ぐ巨炮叔叔 提交于 2021-02-10 12:13:23
问题 Why are there clj and cljs folders in my lein re-frame template as below? And why do they both include files called .core that appear to use the same namespaces? I've been told this is the place to start when learning re-frame, but I cannot find any explanations of why the templates are setup the way they are or created including the content they include. There is no explanation for any of the boilerplate or code that comes with any lein template which make them very hard to use for beginners

Read in file with client-side clojurescript/re-frame app

谁说胖子不能爱 提交于 2021-01-28 05:41:02
问题 I'm writing a client-side application which should read in a file, transform its content and then export the result. To do this, I decided on Re-Frame. Now, I'm just starting to wrap my head around Re-Frame and cloujurescipt itself and got the following thing to work: Somewhere in my view functions, I send this whenever a new file gets selected via a simple HTML input. [:input {:class "file-input" :type "file" :on-change #(re-frame/dispatch [::events/file-name-change (-> % .-target .-value)])

Why are multi-methods not working as functions for Reagent/Re-frame?

旧时模样 提交于 2021-01-20 23:41:08
问题 In a small app I'm building that uses Reagent and Re-frame I'm using multi-methods to dispatch which page should be shown based on a value in the app state: (defmulti pages :name) (defn main-panel [] (let [current-route (re-frame/subscribe [:current-route])] (fn [] ;... (pages @current-route)))) and then I have methods such as: (defmethod layout/pages :register [_] [register-page]) where the register-page function would generate the actual view: (defn register-page [] (let [registration-form

ClojureScript function prints strings, but will not return hiccup

心不动则不痛 提交于 2019-12-25 01:44:07
问题 I have a ClojureScript component: (defn main-panel [] (def nodes (-> @(re-frame/subscribe [::subs/nodes]))) (defn list-nodes [node] (prn (node :name))) (reagent/create-class {:component-did-mount (fn [] (api-service/get-file-tree)) :reagent-render (fn [] (doseq [node nodes] (if (= (node :depth) 0) (list-nodes node))))})) which prints strings to the console. But when I change the first function to: (defn list-nodes [node] [:<> [:h1 (node :name)]]) I don't get any html that is rendered - no