This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-04
Channels
- # adventofcode (154)
- # announcements (1)
- # babashka (8)
- # beginners (28)
- # bristol-clojurians (3)
- # calva (131)
- # cider (43)
- # clj-kondo (14)
- # clojure (135)
- # clojure-europe (1)
- # clojure-italy (7)
- # clojure-madison (1)
- # clojure-nl (6)
- # clojure-spec (8)
- # clojure-uk (90)
- # clojurescript (47)
- # core-async (9)
- # cryogen (4)
- # cursive (12)
- # datomic (9)
- # emacs (7)
- # fulcro (5)
- # graalvm (56)
- # joker (4)
- # juxt (1)
- # leiningen (6)
- # off-topic (62)
- # pathom (4)
- # pedestal (2)
- # reagent (2)
- # reitit (5)
- # ring (2)
- # schema (4)
- # shadow-cljs (133)
- # sql (38)
- # tools-deps (10)
- # vim (28)
Hi all - complete fulcro newbie here. I’m working through the Fulcro book “Getting Started” section and it’s unclear to me if it is :initial-state
or :query
parameters of defsc
that define the structure of the database. Can anyone illuminate me on this point?
Database is just a map, it doesn’t have a structure in the sense of e.g. RDBMS. What’s going on is that when you df/load! a component it gets recursively normalized based upon ident and query params and that normalized data is then merged into the database. You can think of initial state as of the data which is normalized and merged on the app start (from the root component).
@U0G3C3USJ i gave a talk on this exact topic recently https://www.youtube.com/watch?v=PMbGhgVf9Do
^ video goes into more detail with examples, but in short :ident
defines the tables names and identity points of the data, :initial-state
specifies how the DB should be initialized only on app start, :query
is used for multiple things (loading remote date, normalizing sub-entities, loading UI centric data)
@UDQ2UEPMY @U09FEH8GN Many thanks for the insights - I’ll digest and get back to you guys if I have questions.