Fork me on GitHub
#om
<
2017-08-18
>
tony.kay06:08:40

@briantrice I personally prefer working on components and portions of the UI in a devcard with :inspect-data true. This is also made a bit easier if you use the trick from Fulcro of InitialAppState co-located with components.

tony.kay06:08:20

because then it is easy to factor the thing into pieces and embed them…well, in stock Om Next, the parser can make that a bit difficult I guess, unless you’re mostly using db->tree

cjhowe14:08:26

is it possible to have completely dynamic queries with om.next? i need to calculate my query based on props

cjhowe14:08:48

om/set-query! is close, except the parent component still causes the child to render without the query data

petterik14:08:11

@cjhowe I tried and had a lot of problems with dynamic queries when starting out with om.next. What I tried to do was to use the this passed to om/IQuery (query [this]) to check if it's a component, get the props and do what I wanted. This approach never worked because of how the indexer worked at the time. Another thing I tried to do to get dynamic queries was om/set-query which, as you mentioned, has problems. What I recommend "dynamic queries" is to do union queries for all your cases and "choose" the join (or joins) in your union query depending on your app-state at read time.

briantrice16:08:05

@tony.kay oh! I’m still new to this ecosystem and have only heard the word “devcard” and not gotten my lein cljsbuild to deliver them. I’ll see again

tony.kay18:08:14

@briantrice So, try out the fulcro template at https://github.com/fulcrologic/fulcro-template. It’s a fully-working project that also includes devcards. Fulcro was renamed from Untangled, and there are some videos on the old name that demonstrate what I’m talking about. This on in particular should be of interest to you: https://youtu.be/uxI2XVgdDBU?list=PLVi9lDx-4C_T_gsmBQ_2gztvk6h_Usw6R

briantrice18:08:46

oh! okay. I’ll make a checkout and tinker with it soon

eraserhd19:08:14

I'm on om.next and having quite a bit of trouble with some Material UI text edit fields. Every edit moves the cursor to the end of the field. I found React issues about this, but, AFAICT, om.next prevents the React work-around.

eraserhd19:08:27

Anyone know about this?

gardnervickers19:08:51

@eraserhd Make sure you’re properly setting your react-key to avoid re-renders.

gardnervickers19:08:10

Sounds like the backing component is being re-mounted on every keystroke.

eraserhd19:08:17

The :key property, you mean?

eraserhd19:08:53

This is definitely being set correctly. Just double-verified.

eraserhd19:08:45

If I use :defaultValue instead of :value, it works!