Fork me on GitHub

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™


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


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


Thanks for the confirmation!


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


I think I've done that once


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


Is there something you do that avoids that sitution?


A particular approach?


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


Do you have anything that you can share?


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.


@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.


if that makes any sense


@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.


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


I should make it my mantra 🙂


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?


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


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)