Fork me on GitHub
#om
<
2016-08-24
>
grzm13:08:49

Does it make sense to have a component that exists only to have access to a common query (something that's used by some other components? I'm never going render the component directly. I feel like I'm Doing It Wrong™

anmonteiro13:08:50

@grzm: people have been doing that for normalization, yes

grzm13:08:07

Cool. That's exactly what I'm using it for.

grzm13:08:11

Thanks for the confirmation!

grzm13:08:42

@anmonteiro In the statement "people have been doing that for normalization", are you a person?

anmonteiro13:08:05

I think I've done that once

anmonteiro13:08:24

I can't recall because I haven't touched that project in a while

grzm13:08:25

Is there something you do that avoids that sitution?

grzm13:08:34

A particular approach?

anmonteiro13:08:55

@grzm: I can't say without a specific example

anmonteiro13:08:14

Do you have anything that you can share?

grzm13:08:31

gotcha. I've got some bugs to work out right now, but I'll see if I can extract something useful to talk about later.

mitchelkuijpers13:08:16

@grzm we have a ns called domain where we have put all queries that are relevant for the domain of our application and then we have default components for this without a render function, this is very useful because there are many times you only want to get and normalize the data when you give it to a component without a query. We also put our ident functions there to reuse.

mitchelkuijpers13:08:25

if that makes any sense

grzm13:08:44

@mitchelkuijpers yeah, that does. I'm always surprising myself realizing that for the most part all of this stuff is just data that gets passed around. For example, It's not like something magical gets returned by om/get-query: it's just that data structure that query returns. Remembering I can do everything I would normally do with functions and data — just like you're suggesting — is always refreshing.

anmonteiro13:08:52

@grzm: that realization is probably the beginning of your enlightenment wrt. Om Next :-)

grzm14:08:16

I should make it my mantra 🙂

grzm19:08:47

I've been trying to find the om/om next documentation on how to return data besides tempids from a mutation and am coming up empty. I'm sure I've seen it before, but I can't put my finger on it right now. Any pointers?

chris-andrews19:08:37

you could create a remote which takes a transaction and returns some data, possibly performing some side effects based on the transaction

chris-andrews19:08:18

Does anyone know if it would be a good or bad idea to use ref->components as a check for whether cached entity data can be discarded (meaning there are no more components with a given Ident, so the data can discarded from app state)