Fork me on GitHub
#untangled
<
2017-03-29
>
claudiu06:03:07

oh fudge :)… was so focused on initialAppState that I totally forgot about started-callback.

urbank12:03:59

So I have a union query that chooses between different views (like the tabs), but the views have some table data in common. There can be quite a few of these views. When one of those views adds a new entity to a table that another view in the union is suppose to render as well, is the idea to update all the ident vectors in the other view(s) in the union?

urbank12:03:00

When view1 adds an 'ent' the ent has to be added to the ent/by-id table as well as all the :ents vectors in different views

urbank12:03:25

it could also be done when changing view

gardnervickers16:03:00

@urbank Yes that would be the right approach. Something we do frequently is to have another level of normalization:

{:ents/list-of {:ents/all [[:ent/by-id 1] [:ent/by-id 2]] :ents/some [...]}}

gardnervickers16:03:08

This approach ends up manifesting on the server side as two different types of endpoints. 1. :ent/list-of which takes an arg for the kind/sorting/filter of list to provide. 2. :ent/by-id which just handles loading by ident.

urbank16:03:41

@gardnervickers Ok, cool. I suppose another way would be to only update the active view, and update the rest when they become active (through a mutation)

gardnervickers16:03:36

Sure, that is possible, although seems more difficult to do than just updating them all at once.

tony.kay20:03:26

@anmonteiro: and I are grabbing lunch in portland. Anyone else?