This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-23
Channels
- # aws (4)
- # beginners (14)
- # boot (7)
- # cider (75)
- # clara (87)
- # cljsrn (6)
- # clojure (115)
- # clojure-berlin (2)
- # clojure-dusseldorf (2)
- # clojure-gamedev (8)
- # clojure-italy (15)
- # clojure-russia (9)
- # clojure-spec (46)
- # clojure-uk (195)
- # clojurescript (24)
- # css (44)
- # datascript (19)
- # datomic (18)
- # emacs (6)
- # fulcro (57)
- # hoplon (1)
- # jobs (3)
- # jobs-discuss (37)
- # jobs-rus (3)
- # luminus (6)
- # lumo (28)
- # off-topic (24)
- # onyx (11)
- # planck (8)
- # re-frame (31)
- # remote-jobs (12)
- # rum (10)
- # schema (4)
- # shadow-cljs (28)
- # specter (24)
- # sql (3)
- # tools-deps (34)
- # vim (43)
- # yada (10)
hi there, I'm just starting with fulcro and am stumbling over this:
(defsc Person [this {:keys [person/name person/age]}]
(dom/div
(dom/p "Name: " name)
(dom/p "Age: " age)))
@beders it's just normal Clojure destructuring. With let
for example (let [{:keys [a/b]} {:a/b 1}] b)
@beders Destructuring works with or without the colons prefixing the keys. My experience is that it is very common to omit the colons, so {:keys [person/name person/age]}
, or equivalently {:person/keys [name age]}
.
hmm,the realworld app has several article lists that need pagination, i haven't figured out how to choose idents for the pages
article lists like: global articles, personal feed, list of articles by a specific user, list of articles liked by a specific user
[:page/by-id page-number]
is insufficient, while the number of such article lists is infinite
is there support for server sent events in fulcro? Or are websockets the way to go?
@thheller I just noticed something weird, I'm running code from the repl, but I decided to rename an input alias, now even after reloading the page, I can't run commands using the new alias, for eg, before I had [com.wsscode.pathom.connect :as p.connect]
and then I switched to [com.wsscode.pathom.connect :as pc]
now, even though I restarted the remote connection to the repl, I can't run things like ::pc/indexes
, the reader says it's invalid
the old name still works, so I'm guessing there is some cache issue going on
I just changed from the ns
require of it
then reloaded the page
no, I just waited to shadow to compile and reload the actual page (on the browser)
I'm restarting the shadow compilation now
I think after that it might work
even after restating, it still not working
the page loads fine, but its like the REPL is stuck with the old alias
where I can delete all caching to try making it go away?
I tried stopping compiling, reconnecting everything, it still stuck
maybe because the output doesn't change with the alias change?
but I changed other things, so the file was recompiled, weird
I'll double check if I can make it work and if I can reproduce it
Failed to read input: clojure.lang.ExceptionInfo: repl-input.cljs [line 1, col 51] Invalid keyword: ::pc/indexes. {:type :reader-exception, :ex-kind :reader-error, :file "repl-input.cljs", :line 1, :col 51}
but I think the REPL restart might had worked, I just realised I forgot to change ns
on the second time
but the first time I was in the right place for sure
basically the REPL keeps too much state ouside the compiler env which doesn't get updated when watch
recompiles a file
sure, I'll see if I can reproduce it, but I gotta move in a bit, so I may only be able to do that when I get back home
@myguidingstar you want parameters. (load :article-list Article {:params {:list :global :page 1}})
. You’ll get those args in the params of the query on the server. If you mean: “how do I take articles that I have one the client and make lists out of them?“, the answer is: you write a mutation that pulls filters/sorts/paginates the entire client table into a new list (of idents) on some display component’s normalized state , potentially caching the entire result on that component for quicker pagination nav. The pagination example in the book also shows how you could cache a sliding window of pages…all sorts of options, but ultimately it is pure rendering, so the state you want to show on the UI either has to exist in the DB, or be dynamically generated by the UI code itself in a derived way from that state.
Thanks. I think the problem is I was fixated to have pages in db roots, while they can just live in a particular screen local
@chrisblom websockets is the pre-written support that would give you that