Fork me on GitHub

Huh. Not sure why that didn't turn up in my search. Thanks x2!


@ivanreese: I have trouble finding it and I know exactly where it is :)


Also, my re-frame talk for the conj got accepted :) @mikethompson


in regards to my question just above here: is the following understanding correct? the order of operations would be 1. pre-append "A" 2. pre-append "X" 3. console.log(v) 4. post-append "Z" 5. post-append "Y" and then the resulting "AX hello ZY" is just lost in this case? if that's the case, is it safe to say that the :before fns are for coeffects exclusively, and :after fns are for effects exclusively? So I couldn't pass "AX hello ZY" around in a pure sense, but it could pop out in some effect?


@josh.freckleton > if that's the case, is it safe to say that the :before fns are for coeffects exclusively, and :after fns are for effects exclusively? Yes, that's typically what happens. But there'll be plenty of exceptions to this rule. There are some useful Interceptors which don't change either :effects or :coeffects ... they are there for side effects only ... eg: log to js/console or other destination, or check a schema is still valid, etc.


@mikethompson hey mike, thanks for all of your work on re-frame! I just got mildly curious about what Day8 is all about, and my google-fu is failing me... who are you guys? is it an ad hoc team? super secret project? startup? now I'm dying to know where all of the genius that is re-frame comes from, because I'm used to seeing this level of project backed by serious businesses, and I can't find anything about Day8!


@mikethompson thanks for the suggestion, I’ll check out async flow fx.


First time user of the :<- syntax here, good job, reads and works great


@richiardiandrea excellent, that's what we like to hear! @josh.freckleton Naturally, I would like to say that Day8 is a stealthy, startup stocked with young Phds, and 10x genius, which is working on a change-the-course-of-the-universe tech. Except, nothing could be further from the truth. We're actually a small group of older, cantankerous programmers who work in a domain where we have the same clients now that we had 20 years ago. The steadiness of our business would give VCs nightmares :-) Technically, we're recent refugees from Flash and all this new-fangled HTML5 stuff just makes our head hurt. The path prior to Flash is long and storied (never get a grey beard started on the old days). Only one of us is a smartypants Phd and the rest barely graduated from kindergarten. Well, except for the new kid who graduated in music, of all things. Bah humbug, didn't happen in my day. And we have a hysterically bad website, that I absolutely refuse to divulge because it is too embarrassing. Your estimation of us would plummet if you ever found it, I assure you. I personally created it in 1999 when blinking text was cool, and it hasn't been touched since. Just realized that makes it almost 20 years old. It was sooooo on the leading edge when I did it. The Smithsonian called the other day to see if they could preserve it (kidding). In summary, I would encourage you to immediately stop seeking us. You'll only be disappointed. :-) The only good news is that we're going to continue to improve re-frame as best we can.


@mikethompson I'm working with the flash technology last 17 years 🙂 I held on to it despite the all negative things happening around this technology , while an unknown force was brought me to the clojurians and re-frame, and i feel here like at home, and now i understand why 🙂 but Flex still alive on mobile, and i still working with it on my pet mobile projects, i have my small library for featherssdk ( to work like with old friend spark mxml


When using re-frame, is there a way to get the "raw" events stream from the browser, and then filter for events of interest? One example is: I'd like to know what links a user ends up clicking, without setting event-handler info on every [:a...] of the page. Thanks in advance for any advice.


@limist not sure, but event bubbling might help. Try setting an on-click on some (grand-)parent of the [:a ...]


that's also an option, sidestepping React and using actual DOM events


Has anyone here had a look at what React is doing with its new "Fiber" algorithm?


That document is the best explanation so far, although it's woefully incomplete. Seems the big thing is to batch and defer flushing updates, so it's possible to "drop frames" when the browser is too busy. It will also allow for prioritization, e.g. an animation needs more regular redrawing than a comment box


I'm not sure how this would impact CLJS. Most wrapper libs already use requestAnimationFrame under the hood, so in that sense it's (once again) JS catching up with CLJS


it's an implementation detail, public APIs should stay the same, but there might be new knobs and dials to take advantage of


@plexus Where can i rtfm how to do that please? 🙂 Not finding much in the docs so far...


(defn foo []
  [:div {:on-click #(,,,)}
    [:a ,,,]
    [:a ,,,]])


@pepe Thanks for the detailed response! As @plexus pointed out: have you kept React and DOM event handling separate?


@limist only for scrolling


yeah to be honest I have no idea how to help you beyond that, not sure how hard it is to get a reference back to the a, just shooting some suggestions 🙂


I think is always what have been clicked on. But not sure 😉


@limist you are welcome


BTW. today, on @darwin's recommendation I removed the figwheel repl in favor of the Dirac's one and compilation seems smoother. Maybe my feelings only thou. Does anybody tried the same?


am I right that subscription like this

 (fn [db [_ key]]
   {key (get db key)}))
will be pretty efficient, despite depending on the whole DB? The plan is to use it in the following subscriptions to "scope" their updates to a subset of DB


my gut feeling is that subscription like

 :<- [:by-id :by-id/foo]
 :<- [:by-id :by-id/bar]
 (fn [[foos-by-id bars-by-id] _]
will create 2 "actual" subscriptions and will be triggered only if (get db :by-id/foo) or (get db :by-id/bar) returns different value (where "different" is "not identical"). Is it true?


@plexus re: React Fiber: it seems that it goes deeper than what we have in CLJS. If I understand that correctly, they are going after virtual DOM diffing between "DOM versions", so projects like re-frame will immediately benefit from that


I'm wondering how much the Fiber will degrade throughput. I can see that they mostly care about releasing main thread to maintain decent FPS, but their custom scheduling and call stack will probably hurt perf somehow.


is this the best way of handling form inputs? it seems inefficient to fire a dispatch every time the input changes:

[:input {:on-change #(re-frame/dispatch [:search-input-entered (-> % .-target .-value)])}]


@josh.freckleton the inputs in re-com allow you to fire a dispatch only on-blur


probably can do the same for a standard input too


@danielcompton thanks, that's not a bad idea. i was tempted to avoid needing to keep the inputs' values in the main db atom, but, that'd be dodging the point of re-frame I think. also, I'm happy to make a PR on this feature if I have a little guidance as to what's going on:


(or help with documentation)


(and I just tested on-blur, works great)


@si14 > will create 2 "actual" subscriptions and will be triggered only if (get db :by-id/foo) or (get db :by-id/bar) returns different value (where "different" is "not identical"). Is it true? Not quite true. Changes will propagate through a signal graph when nodes in that graph compute a "different" value. And "different" is determined by = (it used to be identical? prior to Reagent v0.6.0) . So it is not that (get db :by-id/foo) is not = to the previous value, rather it is that the value computed by nodes like {key (get db key)} is not = to previous. So the propagation of values through the signal graph is "pruned" when a node computes a new value which is = to what it previously computed.


@josh.freckleton if you change :on-change to :on-blur you wont fire a dispatch each time it changes (only when the search box leaves focus..), but you might want to search for a way to debounce the event