Fork me on GitHub
#re-frame
<
2023-10-02
>
Casey16:10:01

I first asked this in #pyramid but I think it's more of a re-frame user question. You can /s/pyramid/datascript/ or doxa or your normalized db of choice.. How are you all using pyramid in frontend apps (perhaps using re-frame) where a component needs some entity, but also that entity's relationships? It seems like all my components have to subscribe to the whole db, so they can get a handle on it to pull out the data they need. Is there a pattern you've find that works well? Like perhaps use pyramid in the rf/reg-sub to yoink out all the needed data on a per-component basis? Or is it better for the views to subscribe to multiple entities in the db?

p-himik16:10:09

> It seems like all my components have to subscribe to the whole db, so they can get a handle on it to pull out the data they need. Create a sub that receives all the necessary instance-identifying information and retrieves that instance from the db. Then use that sub in all your components.

1
p-himik16:10:29

Ideally, views should only receive what they need, and nothing else.

1