Fork me on GitHub
#re-frame
<
2018-11-15
>
Lu00:11:23

@mikethompson When would a Form-2 be useful? I believe I’ve always just used Form-1

eternalNoob00:11:32

@mikethompson That works for this case. But for the actual problem I am trying to solve, it looks like the underlying problem I have is with the pagination table and the dropdown. But thanks a lot!

mikethompson00:11:20

@lucio you use Form-1 most of the time. Use form-2 (and form-3 for that matter) when you need a stateful component, not a pure component.

(defn myview [] 
  (let [*r   (reagent/atom "hello")]
    (fn [] 
         ....))  

Braden Shepherdson18:11:51

request for a doc: dos and donts

Braden Shepherdson18:11:12

for example, is it a sin to @some-sub multiple times in a (form-1) view?

manutter5118:11:08

I would more likely use (let [some-val @some-sub] #(multiple-uses-of some-val))

urzds18:11:14

Are events always handled in the order they were dispatched?

urzds18:11:38

I understand that this is not guaranteed for effects, but I do not remember reading it about events.

urzds18:11:23

Is there something like dispatching an event and registering an interceptor to be run after the event has been handled? I.e. independent of the original definition of the event, but only for my own invocation of it.

urzds19:11:54

This seems important in the context of re-graph, where I first have to dispatch ::re-graph/init, before dispatching e.g. ::re-graph/subscribe. If events are handled in a different order, the subscription would fail.

manutter5119:11:19

@urzds The ::re-graph/init call sounds like a good case for dispatch-sync

Braden Shepherdson20:11:12

I had the impression that dispatched events are just queued up until the next frame. @urzds read the code for dispatch?

mikethompson21:11:03

@urzds events are handled FIFO