Closed cgrand closed 5 years ago
Okay, it simplifies things to switch to query-all-the-things and we get these paths:
([[?child12620] [[(ground 0) ?child12620]]] [#{?id12623} [[?id12623 :item/title title] [?id12623 :item/status status]]])
([[?child12620] [[(ground 0) ?child12620]]] [#{?id12623} [[?id12623 :item/title title] [?id12623 :item/status status]]] [[?child12624] [[(ground 0) ?child12624]]] [[title] []])
([[?child12620] [[(ground 0) ?child12620]]] [#{?id12623} [[?id12623 :item/title title] [?id12623 :item/status status]]] [[?child12624] [[(ground 1) ?child12624]]] [[status] []])
which translate to:
[:find ?child12620 ?id12623 :where [(ground 0) ?child12620] [?id12623 :item/title title] [?id12623 :item/status status]]
[:find ?child12620 ?id12623 ?child12624 title :where [(ground 0) ?child12620] [?id12623 :item/title title] [?id12623 :item/status status] [(ground 0) ?child12624]]
[:find ?child12620 ?id12623 ?child12624 status :where [(ground 0) ?child12620] [?id12623 :item/title title] [?id12623 :item/status status] [(ground 1) ?child12624]]
Let's go back to step 2.
[[0] [12345]]
, [[0] [12345] [0] ["title"]]
and [[0] [12345] [1] [false]]
.ensure
there's a component for the path. Ensuring a component may instantiate it. Let's consider this protocol:
(defprotocol Component
(ensure! [c k] "Returns the child component")
(delete! [c k] "Deletes the child component"))
Thinking out loud about what happens at runtime (todo list example).
with
, this LQ emits a path[0] [] [12345] ["title" false]
:[0]
is the key in the root fragment (the one with the<ul>
) to identify its first and only child: thewith
. Then[]
is additionals values (always empty fro fragments) then a key anew[12345]
this time its the eid of the new item, it's the identifier of the iteration, and then additional values.[0] [12345]
,[0] [12345] [0] ["title"]
and[0] [12345] [1] [false]
then, in this world, we have full selectivity and all the diffing logic is removed from fragments etc. We also don't have the keys/other vals split