Fork me on GitHub
#re-frame
<
2015-11-02
>
nowprovision04:11:37

How are people handling load items from server (initial payloads etc..), a global :loading bool in app-db or actually substitute the values e.g. :people { :status :loading } -> :people { :status :ok :value [{p1}.{pe}] } ?/

mikethompson05:11:28

@nowprovision: if you have N things to be loaded then, one way or another, you'll need N flags to indicate the success or otherwise. You can use the existence of the data itself as the flag of course. :people is nil if not loaded, or otherwise a value.

mikethompson05:11:47

Of course, if there are errors, then you may want to keep them too. Which leads you back towards the {:status :ok :values [...] :error "timeout"}

nowprovision06:11:54

thinking out load again, https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/views.cljs when using on-click #(dispatch blah) then wouldn't this break = and identical? causing un-necessary computation of the render payload.. However this is mitagated because render will only be called when either the props passed in changes or ratoms deref?

nowprovision13:11:56

rethinking my design decisions again, here https://github.com/nowprovision/webhookproxyweb/blob/master/src-cljs/webhookproxyweb/components/webhook/view.cljs#L75 I have a free floating atom to work with re-agent forms proj, would it make more sense to use a cursor on the ratom instead https://github.com/reagent-project/reagent/blob/master/src/reagent/ratom.cljs#L240?

martinklepsch17:11:57

when I dispatch an event in a handler is there some guarantee that the app-state has changed (by current handler) when the dispatched event is handled?

darwin17:11:19

@martinklepsch: yes, dispatches get serialized (via core.async channel)

darwin18:11:40

@martinklepsch: btw. the router loop is really simple, it handles a single event at a time, in this loop: https://github.com/Day8/re-frame/blob/master/src/re_frame/router.cljs#L45

martinklepsch18:11:21

yeah I remember seeing this before. The original reasons why I doubted suddenly vanished 😜

richiardiandrea20:11:51

guys, if re-com/google closure throws a Uncaught TypeError: Cannot read property 'appendChild' of null, what am I doing wrong?

darwin20:11:35

@richiardiandrea: this might not be related to re-frame or re-com, something just gets evaluated to null and you call .appendChild on it

richiardiandrea20:11:08

mmm...it does it in crosspagechannel.js:485 parentElm.appendChild(iframeElm); I don't even know where it comes from, I assumed it was reframe

darwin20:11:34

so parentElm is null for some reason, you have to figure out why

darwin20:11:54

I’m not familiar with re-com, so I don’t know where it comes from

richiardiandrea20:11:13

ok will investigate, maybe it is not related as you said

darwin20:11:56

let your devtools break on exceptions and inspect call stack

mikethompson21:11:09

@darwin clj-devtools is just so good

richiardiandrea22:11:16

@darwin: it was due to the fact that my compiled js was included in <head> and not in <body>

richiardiandrea23:11:16

can a :child of a box be a react component in re-com?