This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-20
Channels
- # announcements (8)
- # babashka (19)
- # beginners (100)
- # boot (3)
- # calva (16)
- # cider (8)
- # cljdoc (6)
- # cljsrn (15)
- # clojure (73)
- # clojure-europe (7)
- # clojure-france (1)
- # clojure-italy (12)
- # clojure-nl (11)
- # clojure-sg (1)
- # clojure-uk (17)
- # clojurescript (63)
- # cursive (22)
- # data-science (2)
- # datomic (2)
- # defnpodcast (1)
- # docs (1)
- # fulcro (7)
- # graalvm (8)
- # jackdaw (1)
- # kaocha (11)
- # off-topic (26)
- # pedestal (4)
- # planck (1)
- # re-frame (35)
- # reitit (5)
- # ring (3)
- # shadow-cljs (25)
- # slack-help (11)
- # spacemacs (8)
- # specter (2)
- # tools-deps (61)
- # vscode (6)
- # xtdb (3)
(ns app.client
(:require
[com.fulcrologic.fulcro.application :as app]
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.dom :as dom]
[com.fulcrologic.fulcro.algorithms.merge :as merge]
[com.fulcrologic.fulcro.algorithms.data-targeting :as targeting]))
(defsc Car [this {:car/keys [id model] :as props}]
{:query [:car/id :car/model]
:ident :car/id}
(dom/div
"Model " model))
(def ui-car (comp/factory Car {:keyfn :car/id}))
(defsc Person [this {:person/keys [id name age cars] :as props}]
{:query [:person/id :person/name :person/age {:person/cars (comp/get-query Car)}]
:ident :person/id}
(dom/div
(dom/div "Nameeee: " name)
(dom/div "Age: " age)
(dom/h3 "Carssssss")
(dom/ul
(map ui-car cars))))
(def ui-person (comp/factory Person {:keyfn :person/id}))
(defsc Sample [this {:root/keys [person]}]
{:query [{:root/person (comp/get-query Person)}]}
(dom/div
(ui-person person)))
(defonce APP (app/fulcro-app))
(defn ^:export init []
(app/mount! APP Sample "app"))
(comment
(reset! (::app/state-atom APP) {})
(swap! (::app/state-atom APP) update-in [:person/id 2 :person/age] inc)
(merge/merge-component! APP Person {:person/id 2
:person/name "Bob"
:person/age 21
:person/cars [{:car/id 1
:car/model "F-150"}]}
:replace [:root/person])
(app/current-state APP)
(app/schedule-render! APP))
I got this error `Syntax error compiling at (src/app/client.cljs:14:3). No such var: com.fulcrologic.fulcro.dom/macro-create-element*`
Typo in the book. That function is in some other ns from 2.x to 3.x…pls indicate a link to the section of the book
Hi, I am trying to implement a progress update where the information is coming from the server. I have implemented an UISM as per suggestion from last Thursday/Friday and I can generate the events to set a timer and then generate a new event. But how can I force a reload of the data on an event?