untangled

NEW CHANNEL: #fulcro
claudiu 2017-03-31T04:21:27.027111Z

adding :top-router to (om/transact! comp-or-reconcilerโ€ฆ seems to do the trick.

urbank 2017-03-31T13:41:39.158770Z

Do I understand the idea of the forms portion of the untangled-ui library correctly? Basically, a form targets some entity in the app-db, so that values entered into the form component are committed to that entity

mitchelkuijpers 2017-03-31T15:12:34.103754Z

We laughed our asses off

fatihict 2017-03-31T15:52:04.967395Z

@urbank https://youtu.be/Odp0M39g-LM

urbank 2017-03-31T15:52:30.976914Z

@fatihict Thanks!

urbank 2017-03-31T15:57:21.082872Z

So perhaps I'm abusing initialAppState

urbank 2017-03-31T15:58:02.097298Z

I have a defui component without render that declares the query, ident and initialAppState for an entity in the app-db

urbank 2017-03-31T15:59:08.120607Z

Then there are supposed to be a bunch of other components which are forms that edit entities of this type

urbank 2017-03-31T16:10:45.371301Z

Ok... so it was my error that it wasn't working. Called the wrong query. Still, did I stumble upon the correct solution. If I want to initialize an entity in the initial state, that multiple components will render and edit, I declare it's query, ident and initial-state in a defui

urbank 2017-03-31T16:11:14.380736Z

then I use them in the components that are supposed to edit this entity

urbank 2017-03-31T16:12:49.413226Z

I compose its initial state and query into their initial states and queries. To make it all the same entity, I give the Entity component a default id, so that get-initial-state always yields the same entity, even if called on many components

tony.kay 2017-03-31T22:03:45.697078Z

@urbank

tony.kay 2017-03-31T22:04:16.702927Z

Yes, the form keeps an alternate state for the entity. When you commit it, it copies it over. It also supports sending the delta remotely

tony.kay 2017-03-31T22:04:25.704798Z

look in the devcards for it...the docs are close to good ๐Ÿ™‚

tony.kay 2017-03-31T22:14:04.808861Z

@mitchelkuijpers @fatihict Glad you guys enjoyed it. If you haven't seen "The Doctor" Kids in the Hall sketch, you should watch it...it's kinda older, and no one got that one at all

fatihict 2017-04-01T12:56:51.015183Z

Ahhh, now I see. I didn't get that one either, but that's hilarious ๐Ÿ˜ƒ. Also the ending about the cake was cruel ๐Ÿฐ๐Ÿ˜†

tony.kay 2017-03-31T22:14:34.814236Z

https://youtu.be/Pbjypn9JtKE?t=12s

urbank 2017-03-31T22:17:52.849244Z

@tony.kay The guide cleared up a lot... there's still a question forming, but it isn't quite ready ๐Ÿ™‚

urbank 2017-03-31T22:26:50.939622Z

@tony.kay I think there's a small error in the guide.

urbank 2017-03-31T22:27:04.941824Z

(f/form-field my-form :name) --- outputs ---> (dom/input #js { ... }) should be

urbank 2017-03-31T22:27:16.943821Z

(f/form-field comp my-form :name) --- outputs ---> (dom/input #js { ... })

urbank 2017-03-31T22:38:17.048126Z

when calling f/form-field is it possible to specify attributes of the resulting input? For instance, to add a call to commit onBlur? I see that I can pass things like :className to f/text-input in IForm, but is there a way to do it dynamically?

urbank 2017-03-31T22:53:32.184914Z

Hm... for some reason commit-to-entity! isn't updating the target entity

urbank 2017-03-31T23:09:13.322887Z

Yes, so apparently the entity ended up in the database because the other view in the join query didn't yet implement form. So a component with just a form did not even create the actual entity that the form was supposed to augment. So I must be missing something.

urbank 2017-03-31T23:10:42.334786Z

All the examples in the guide some to be such that entity IS the form... so where is it committing if there isn't an unaugmented version of the entity in the app-db?

urbank 2017-03-31T23:13:47.359062Z

In my case I have a type of Entity which is a defui that just declared initial-state, query and ident. Then there are a bunch of forms which all edit this entity same entity. However, the entity doesn't end up in the initial state, because it isn't directly used in a Query

urbank 2017-03-31T23:14:37.365610Z

But rather:

urbank 2017-03-31T23:19:21.401912Z

So I see why Entity doesn't end up in the database... but what do I do so that it will? started-callback? Entity doesn't really have 1 representation in the ui, but multiple views which edit it.