Fork me on GitHub
#om
<
2016-04-16
>
currentoor17:04:04

Are we supposed to define mutation functions in the root component? Like so https://github.com/Jannis/om-next-kanban-demo/blob/master/src%2Fkanban%2Fapp.cljs#L27

iwankaramazow17:04:03

@currentoor: if it works for your app, roll with it

currentoor17:04:00

@iwankaramazow: very true but I was also hoping to understand why, could be I’m doing something wrong that will come around to bite me later?

iwankaramazow17:04:20

@currentoor: it's more of a syntax style, more like the classic React components which are a 'declarative' description of some UI part

iwankaramazow17:04:08

Nothing wrong with it

currentoor17:04:49

I see, in my app it only works if I define the mutation in the root component.

currentoor17:04:57

Thanks for answering.

iwankaramazow17:04:40

@currentoor: in terms of coupling, with this approach, there is coupling between a component & some mutation

iwankaramazow17:04:59

but that's just theoretical design

currentoor17:04:28

@iwankaramazow: yeah that is what I’m worried about. But if I move the mutation definition down one level the UI breaks (then fixed by another mutation from root).

currentoor17:04:00

I’d like to know why it breaks and then decide what the best architecture is for the particular situation.

iwankaramazow17:04:43

@currentoor: I'll test it out

currentoor17:04:47

@iwankaramazow: are you the author of that kanban app?

iwankaramazow17:04:07

@currentoor: haha no, definitely not

currentoor17:04:25

oh ok, thanks for helping all the same!

devth18:04:49

using om/update-state! in an onChange handler for a material TimePicker component prevents the change from actually being applied to the component. ideas?

devth18:04:35

it's as if i cancelled the event. works fine for DatePicker otoh

devth18:04:03

> Will schedule the component for re-render.

devth18:04:09

interfering somehow?

iwankaramazow18:04:38

@anmonteiro: Have you ever encountered a scenario where you have to run a bunch of mutations after a remote mutation has completed?

anmonteiro19:04:46

@iwankaramazow: thought about it but never did encounter that scenario

anmonteiro19:04:34

you’d maybe want to override the default merge to do that?

iwankaramazow19:04:04

I'll try it that way, I probably can't hook into the reconciler's send to supply a custom merge! as callback?

anmonteiro19:04:01

well, merge! just calls default-merge so you can change that?

iwankaramazow19:04:41

Oh overlooked it

iwankaramazow19:04:48

nice, I'll try that

iwankaramazow19:04:01

Thanks for the ever enlightening info 😄

isak19:04:53

@currentoor: it is because the component you pass into trasact influences the read that gets triggered

currentoor19:04:14

@isak: makes sense thanks!

currentoor22:04:54

I’d like to use this function to retrieve a previous state from history, https://github.com/omcljs/om/wiki/Documentation-%28om.next%29#from-history But how do I programmatically get the uuids of the previous states?

devth22:04:07

i'm trying to send (om/get-state this) as the params in a om/transact! but it errs "is not ISeqable" - anyone know what's up with that?

devth22:04:22

ugh, forgot to unquote it 😓