om

Please ask the channel first, not @dnolen directly!
2017-03-18T12:35:48.974256Z

What is the query syntax to read from the root of the application state using a parameterized join query from a deeply nested component? Links (https://github.com/omcljs/om/wiki/Thinking-With-Links%21) only seem to be appropriate for simple ident queries. Here is the query that I am want to be read from the root

'[({:hosting-service [:org]} {:url "<https://www.squarespace.com>"})]

2017-03-18T13:08:41.065970Z

i believe links have to start with an ident (two element vector), there are some more query examples in the tests:

2017-03-18T13:11:25.074270Z

@danvingo thanks, the following seems to work

'[({[:hosting-service _] [:org]} {:url "<https://www.squarespace.com>"})]

2017-03-18T13:13:08.079047Z

np, i've actually never seen an example like that, what is this query returning?

2017-03-18T13:13:41.080783Z

the url of an org that's embedded in a hosting service?

2017-03-18T13:15:18.085636Z

The query returns the hosting provider info of any site based on the URL that is passed to it

2017-03-18T13:15:43.087088Z

ah, so url is the param?

2017-03-18T13:15:48.087317Z

yes

2017-03-18T13:15:54.087668Z

nice, very cool

2017-03-18T13:16:00.088033Z

🙂

peeja 2017-03-18T14:36:59.344767Z

Has anyone worked on pubsub via Om yet? I'm thinking through what you'd need to do. I think you'd want a send that received the entire root query each time it changed, rather than just a subset of it, which is what a send normally gets if a portion of the UI tree changes its query.

peeja 2017-03-18T14:37:25.346188Z

That is, you'd want the entire root query so you could diff it against the last one you saw and decide what to subscribe to and what to unsubscribe from

peeja 2017-03-18T14:37:47.347342Z

Alternatively, Om could take responsibility for doing the diffing and give the send the diff

jannis 2017-03-18T15:49:30.605374Z

@peeja I implemented a similar approach partially in a project. There, we also subscribe with the root query and push updates to the query to the subscription service whenever it changes. That by itself is probably the easiest part – the trickier part is keeping track of which query (or partial query) of which clients are interested in which parts of the remote db. We got as far as distinguishing between queries for particular data (i.e., parameterized with a specific db record ID such as a specific user ID) or for a collection of data (e.g. all users, kind of like wildcards). And then you’d have to index all client queries smartly, monitor the db for changes, match client queries against these changes and push the right things to the right clients. I think that’s much harder than obtaining the root query. 😉

sineer 2017-03-18T19:30:44.434499Z

@peeja have you seen this clever om/datascript/datomic pub sub (using sse): https://github.com/madvas/todomvc-omnext-datomic-datascript

foobar 2017-03-18T20:45:00.689486Z

I want to reset! my om.next state (its a datascript db) but om.next no longer likes it No protocol method IWithMeta.-with-meta defined for type cljs.core/Atom

foobar 2017-03-18T20:45:25.690976Z

Any work arounds?

foobar 2017-03-18T21:14:27.786893Z

nm

lucasbradstreet 2017-03-18T22:49:15.074630Z

In om.next, should ids that have been updated from tempids to real ids trigger a rerender?

lucasbradstreet 2017-03-18T22:51:39.081843Z

nevermind, it definitely does trigger a rerender in some parts, so I’m obviously doing something wrong

2017-03-18T23:21:07.167247Z

Is there a way to pass arguments when defining (not instantiating or creating) a component that would have that argument as a static property? Ie. is it possible to have

(defui MyComponent
static
(aaa [_] something-dynamic)
)
Where something-dynamic is defined somewhere else in the code?

anmonteiro 2017-03-18T23:25:23.179773Z

@nha hrm, this is possible:

(defui Foo
  static field foo 42)

anmonteiro 2017-03-18T23:25:32.180271Z

not sure if it's what you're looking for

raspasov 2017-03-18T23:53:08.258039Z

has anyone implemented IO/network retries in om.next and how did you go about?