Fork me on GitHub
#om
<
2015-08-22
>
joshg21:08:12

What’s the best way to use datascript with om?

joshg21:08:23

The examples I’ve seen re-render all components whenever the db changes.

jackjames22:08:14

@joshg: 1) that doesn't necessarily sound like a problem to me

jackjames22:08:58

2) haven't explored the om/datascript combo myself, but i think that sean grove may have some recent work worth a look here: https://github.com/sgrove/dato

joshg22:08:14

@jackjames: Thanks for the response. I’ll take a look at dato. I have an Om frontend and would like to use Datomic for the DB. I’ve looked at om-sync, but it seems like everything will change with Om Next.

joshg22:08:41

Many people appear to be synchronizing state using Datascript locally

jackjames22:08:29

@joshg: if you can put it off, it sounds like a much clearer om + datascript story is fairly likely to emerge in the next few months (ish) w/ om-next

joshg22:08:03

I need to get something working in the interim. I wish om-next was a little more baked.

joshg22:08:15

@jackjames: do you know if om next will still make component local state available?

jackjames22:08:28

@joshg: i mean, i can't say that i know, but i would put it at about 100% chance that it will. the current incarnation of om-next certainly does so, and it's kind of a key piece of om's overall philosophy

joshg23:08:19

Thanks, that’s good to hear. I didn’t see it in the defui examples and was wondering how to create components like drop-downs without local state.

jackjames23:08:21

yeah, not used in the examples, but def alive & well: https://github.com/omcljs/om/blob/master/src/om/next.cljs#L62

joshg23:08:58

pkobrien: would you recommend using om next for an application today?

joshg23:08:51

I saw that repo but the implementation seemed incomplete

meow23:08:52

@joshg: I would definitely not use om next for an app today, because dnolen would not recommend doing so. He is still fleshing it out and there are known parts that do not work. I think he said to expect a beta version by Clojure/conj, which is mid-November.

meow23:08:50

I would simply use Om, avoid the use of reference cursors, keep an eye on Om Next, and expect a modest transition burden to go from Om to Om Next.

joshg23:08:48

That’s what I’ve done: build an om app without ref cursors, but I’m trying to figure out the best way to handle state with a datomic backend given that om next hasn’t been released. Would you build an API and pull updates on IWillMount? Another strategy seems to be syncing changes with a local Datascript store.

meow23:08:22

I posted that link mostly so that you could see that Om Next is definitely targeting Datascript as well as Datomic and the traditional atom/map.

meow23:08:51

@joshg: I'd ask that on the #C03RZMDSH channel

joshg23:08:45

ok, thanks