Fork me on GitHub

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).


@ i gave a talk on this exact topic recently


^ 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)


@ @ Many thanks for the insights - I’ll digest and get back to you guys if I have questions.