This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-07
Channels
- # announcements (1)
- # babashka (77)
- # beginners (219)
- # chlorine-clover (6)
- # cider (52)
- # clj-kondo (14)
- # cljdoc (5)
- # clojure (173)
- # clojure-europe (49)
- # clojure-finland (1)
- # clojure-germany (2)
- # clojure-italy (1)
- # clojure-nl (39)
- # clojure-sweden (4)
- # clojure-uk (51)
- # clojurescript (25)
- # code-reviews (9)
- # conjure (25)
- # data-science (2)
- # figwheel-main (6)
- # fulcro (74)
- # graalvm (1)
- # graphql (11)
- # jobs-discuss (17)
- # keechma (4)
- # lein-figwheel (4)
- # leiningen (1)
- # luminus (10)
- # malli (14)
- # mid-cities-meetup (2)
- # off-topic (28)
- # re-frame (5)
- # reagent (76)
- # reitit (30)
- # ring (7)
- # ring-swagger (1)
- # shadow-cljs (163)
- # spacemacs (11)
- # specter (2)
- # sql (43)
- # tools-deps (13)
- # vim (6)
- # yada (1)
Hi, where can I find the source for this example app
? Is there a getting started guide on how to create a very basic app using keechma ? The hello-world app example does not say how to put everything together and what codes goes in which file. Any help appreciated.
@dionysius.almeida RealWorld app is how we would structure a bigger app with routing, dataloading, forms https://github.com/gothinkster/clojurescript-keechma-realworld-example-app
and for the simple routing app, this is the complete source:
(ns
(:require-macros
[reagent.ratom :refer [reaction]])
(:require
[reagent.core :as reagent]
[keechma.ui-component :as ui]
[keechma.controller :as controller]
[keechma.app-state :as app-state]))
(defn hello-world-routing-render [ctx]
(let [current-name (or (get-in @(ui/current-route ctx) [:data :name]) "")]
[:div
[:label {:for "name"} "Enter your name"]
[:div
[:input
{:id "name"
:on-change (fn [e] (ui/redirect ctx {:name (.-value (.-target e))}))
:value current-name}]]
(when (seq current-name)
[:h1 (str "Hello " current-name)])]))
(def hello-world-routing-component
(ui/constructor
{:renderer hello-world-routing-render}))
(def app-definition
{:components {:main hello-world-routing-component}
:html-element (.getElementById js/document "app")})
(def pretty-route-app-definition
{:components {:main hello-world-routing-component}
:html-element (.getElementById js/document "app")
:routes ["name/:name"]})
(def pretty-route-with-defaults-app-definition
{:components {:main hello-world-routing-component}
:html-element (.getElementById js/document "app")
:routes [["" {:name "Student"}]
["name/:name" {:name "Student"}]]})
@mihaelkonjevic Thank you 👍:skin-tone-3: I managed to get the hello world
app working after some messing around. I'm new to front-end
world, so exploring a few options including keechma
and fulcro
. Cheers 🙂