Fork me on GitHub
#helix
<
2021-07-22
>
wilkerlucio22:07:13

hello @hiskennyness, just got the time to read your response 🙂, so, I can see what you mean by fully data management, and I think Fulcro surely does that as well. About the "cell-style" for recomputation of attributes, that's something Fulcro does in a different way. Instead of rely on the node graphs for the UI render, Fulcro relies on a normalize database, so it tries to guarantee data consistency using normalized data, a fulcro DB usually looks like this:

{:user/id {1 {:user/id 1
              :user/name "Kenny"
              :user/group [:group/id 1]}
           2 {:user/id 2
              :user/name "Wilker"
              :user/group [:group/id 1]}}
 :group/id {1 {:group/id 1
               :group/name "Clojure Devs"}}}

wilkerlucio22:07:47

this way, when data needs to change, we can change in the entity, and all parts of the UI that look at that entity can refresh the data after DB changes (local, in-memory db, that data structure)

wilkerlucio22:07:47

for the part of describing the data relationships, Fulcro uses EQL + Pathom, that's a bigger story, but just to be brief, you can define in Pathom the relationships, and in Fulcro you trigger a "load" to "recompute" the data

lilactown22:07:01

quick question while you're hero wilker: how does fulcro handle secondary keys (if at all)?

lilactown22:07:36

i.e. I want to be able to refer to a user by both [:user/id 1] and [:user/email ""]

wilkerlucio22:07:29

it doesn't, usually what we do is keep id based on the client, but using Pathom you can start the query using a secondary key like :user/email, and let the id load from it

lilactown22:07:39

gotcha. I am contemplating adding secondary keys to autonormal

lilactown22:07:33

seems like a performance/complexity hole tho

wilkerlucio22:07:28

never really tried doing it, but I can see the appeal