This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-28
Channels
- # announcements (1)
- # babashka (9)
- # beginners (82)
- # calva (6)
- # cider (3)
- # clj-kondo (69)
- # cljdoc (4)
- # cljs-dev (10)
- # cljsrn (2)
- # clojure (74)
- # clojure-europe (11)
- # clojure-italy (9)
- # clojure-nl (15)
- # clojure-spec (18)
- # clojure-uk (89)
- # code-reviews (8)
- # core-async (42)
- # cursive (22)
- # datomic (26)
- # fulcro (13)
- # graalvm (33)
- # graphql (1)
- # leiningen (20)
- # malli (19)
- # music (1)
- # off-topic (4)
- # pathom (56)
- # re-frame (3)
- # reitit (26)
- # shadow-cljs (40)
- # spacemacs (5)
- # tools-deps (25)
If I have a Sidebar for navigation, current activate route link will be highlight. what :query
should I use for this Sidebar. I want make sure it will re-rendered whenever route changes.
what confusing me is my Root contains the RootRouter, however, when route changes, the Root will not re-render(test by log). so I don't know how to trigger the re-render for the Sidebar.
Ohh, I think I can make the root re-render by query ::dr/id
, don't know if it's the correct way.
See Ident and Link Queries. http://book.fulcrologic.com/#_link_queries
If you try to understand the mechanism of query and refresh, it becomes very simple. Data retrieval and refresh for the UI is all tied to the query. A link/ident query gets you to a targeted place in the database (instead of relative in the graph). From there, you query for what you need to render. The rendering system uses the query and idents to figure out which components are interested in updates. It really isn’t complicated, it’s just different (since most systems are not truly data-driven all the way through).
Q: I'm getting a bit of a strange error, working on a component that uses a recursive query:
Uncaught Error: ... is not ISeqable
at Object.cljs$core$seq [as seq] (core.cljs:1226)
at Function.cljs$core$IFn$_invoke$arity$3 (core.cljs:2464)
at Function.cljs$core$IFn$_invoke$arity$3 (core.cljs:2551)
at Object.cljs$core$group_by [as group_by] (core.cljs:10834)
at fulcro$client$primitives$denormalize_STAR_ (primitives.cljc:1298)
at primitives.cljc:1276
at Function.G__68373__2 [as cljs$core$IFn$_invoke$arity$2] (core.cljs:4706)
at core.cljs:5631
at core.cljs:5631
at Object.cljs$core$IReduce$_reduce$arity$3 (core.cljs:5635)
Quoting. …
is a symbol, and also make sure it is in the correct position syntactically.
I think I found it: the recursive query starting from a hard-coded link query pointing to a DB entry that doesn't exist yet at page render, but is loaded in later. So not a Fulcro bug, but (as expected) as SNAFU from my part :face_with_rolling_eyes:😏
fixing the hard-coded part made error disappear
Does this ring any bells?
the app keeps working though
(Fulcro 2.8.11)