Fork me on GitHub

@danielcompton in case these 3 calls happen inside the handler with go block, would it block all other events processing?


don’t quite understand your question, but in any possible scenario: no, anything happening inside a go block will happen asynchronously and can’t block events from processing


The only way to block events from being processed is by doing CPU heavy work which will block the thread


@stuartmitchell hi guys. sorry for the delay, @mikethompson mentioned that it would be good to show data for components wich are rendering now, so, I was working on this, and I had to integrate in the component lifecycle, so i decided this shouldn't be in the production code, so i implemented compiler option for the re-frisk, to not generate any code in the production, last thing i wanted to do was draggable and resizable window with the data, and here I'm stuck , reagent works strange with the two reagent/render calls in one project, i don't want to integrate re-frisk in the app, i want separate div for it


i will try to release it today


good news, found the reason of strange behavior


i think i'm ready


one more strange thing, if i'm using only :require-macros , it doesn't include my cljs files , so i have my macro in clj file, it calls my function in the same namespace in cljs file, and if i :require this macro, it WARNING: Use of undeclare var which in my cljs file. hm


I’m not sure if this is what you mean, but you have to use the fully qualified name to refer to functions in the cljs files from clj macros. For example my-project.utils is a cljs function

(defmacro <?
  `(my-project.utils/throw-error (cljs.core.async/<! ~expr)))


@andre: Also, what did you use to make that gif?


yes. i'm using fully qualified name


LICEcap on windows


so, i'm stuck with the macro, i've compiled jar for clojars, included it in my project. :require-macros my macros, and it doesn't work 😞 if i requere my lib by :requere it works, but i can't release this 😞


i need to fix macro



(:require [re-frisk.core :refer-macros [def-view]])
(:require-macros  [re-frisk.core :refer [def-view]]))
works fine, hm


Please provide any feedback, i'm waiting in any time 🙂


@andre testing it soon! Looks super useful so far, thanks! :)


What is better: To have nested components with bound subscriptions by a let, like (let [my-react (subscribe ...))) or using subscribe only on the toplevel or something else?


@robewald: I prefer top level subscribes where I can, but it's really dependent on what you are trying to do and what makes sense for your application. I like to think about whether that component should be interchangeable, what parts of the app or app-db it should know about, if there are performancw concerns, etc. before deciding on which way to go. I often end up refactoring and changing my original decision though.


Hey all, anyone know of a ready-made re-frame effect that will dispatch another event after a timeout? Looking into implementing little status updates that close themselves after 5 seconds or whatnot


It doesn't seem hard to implement myself, was just wondering if it already existed somewhere


Hi, I have a situation where a leaf component inside an outer dynamic component (with :key specified) is definitely being re-rendered when its r/reaction input changes. It renders some hiccup corresponding to a button with the btn-text as its first argument. The txt is changing from one call to the next however the inner button is only being rendered with the original text.


The inner button is a Form-2 component (i.e., (defn a-comp [txt other stuff] (fn [] [blah blah])). That lambda is getting called and blah blah is rendered with the original text but the setup in a-comp does not run even though txt is different from one run to the next (as verified by js/console.log from the calling component).


I would imagine that = comparison for two different text strings would produce a false and thus the component should be re-rendered (incl. its outer setup).


@johanatan: Can you post a minimal repro of what's happening? My first impression is that there's something wrong with the way you've declared one of the components, since that's pretty standard functionality, but if you can get some code for me to work with I'm happy to go into more depth with it.


The other possibility that seems likely to me is that there's some issue with how you are calling the inner component.


Sure, this feels very similar to the previous issues I hit around this functionality. I suppose it's time to bite the bullet and make a minimal repro.


I find every time I have to go that far in troubleshooting it exposes the problem for me. I never want to do it, though. 🙂


Yes, there have been many similar issues for me over the last few weeks that I've been able to resolve without going that far. This one has withstood a couple of hours of the typical onslaught of debugging techniques though so either a) there really is a framework issue here or b) this one is trickier than usual


or c) my brain is behaving like it's 11 pm instead of 11 am (totally possible) 🙂


@shaun-mahood I have a minimal repro.


Although one can see "left" printed to the console, the bkg color of the label does not change from white to transparent. See:


[This isn't the exact failure that I'm seeing in practice: but it is really close (and certainly within the same class of failures)]


I can make the repro a bit more realistic if this turns out to be a red herring.


@johanatan: great, I'll take a look and see if I can find anything useful


rgb should have been rgba


@johanatan: It looks to me like there's an issue with how you are setting the background-color - if I replace :style {:background-color (if @hovered? "#ffffff" "rgb(0,0,0,0)")} with :style {:background-color (my-color @hovered?)} where my-color is defined with

(defn my-color [hovered?]
  (if hovered?
it seems to all work


ok, i'll keep adding some complexity to make it more like the original


Actually with that fix the issue still repros


Notice that the label text doesn't change when you click on it


But if you peek in app-db, the selected set contains the clicked on items


If you can set it up using the lein new re-frame +re-com template it will make it easier for me to test - I had to do some tweaking to your code to get it to run so I might have changed something that is giving you a problem.


i.e., the text should toggle between ALL CAPS and lower-case


How about I just push the entire repo?


That would work too 🙂


@johanatan: If you change your inner function to

(defn inner [label on-click]
  (let [hovered? (reagent/atom false)]
    (fn [label on-click]
      [re-com/label :label label
       :style {:background-color (if @hovered? "#ffffff" "rgba(0,0,0,0)")}
       :attr {:on-mouse-over #(reset! hovered? true)
              :on-mouse-leave #(do (js/console.log "left") (reset! hovered? false))
              :on-click on-click}])))
then I think everything will work - when I fix it, then the on-click handler fires and the text changes to all caps. Explanation for why is at


Ahh! That has probably been my problem with Form-2 components all along!


That makes sense. I remember reading that but for some reason it didn't sink in lol


Yeah it's pretty important. It was a source of a lot of errors for me when I started with re-frame, and is still the first thing I check 🙂


Too bad my initial message: "The inner button is a Form-2 component (i.e., (defn a-comp [txt other stuff] (fn [] [blah blah]))" wasn't enough to give it away


I thought that might be the case, but I don't like jumping to too many conclusions - way nicer to be able to work through the real problem instead of a bunch of wild guesses. Semi-related, if you haven't seen this talk it's one that I recommend any time I get a chance -


I don't really consider that a wild guess as a) it is a commonly stumbled over detail b) my actual initial code example posted clearly exhibited the problem c) it is still scientific to say "here are a few common things to check" (and linking to that article)


It is more like an extremely informed and educated guess-- almost to the level of a deduction really given the code sample posted.


But, anyway, thanks for the help!


Oh, I had other wild guesses waiting in the wings for you if that one didn't work 🙂


Also, if you had made an attempt to understand what was meant by this: "That lambda is getting called and blah blah is rendered with the original text but the setup in a-comp does not run even though txt is different from one run to the next (as verified by js/console.log from the calling component)", you'd have seen that my expectations were not correct.


I expected the "setup in a-comp to run" which was clearly not how this works.


Rather the new arguments are passed into the inner lambda


And thus one needs to capture them there.


Yes, I had some ideas on how to progress and I also had some ideas about where your expectations might have been incorrect. I've also seen your previous questions and I decided based on those that I would rather try and help in a more substantial fashion so you could better understand how things are meant to work in the context of your code, as I find that it is a better way to communicate than simply referring you to the documentation. Hopefully you have a better understanding of things now.


Honestly an answer like "your inner lambda needs to recapture the component props for Form-2 components" would have been perfectly understandable and helpful to me.


[And this was in fact the only thing wrong with any of my code that I've sought help on here for-- the only difference is that the last time(s) I didn't go through with the min repro song & dance]


Anyway, I appreciate your style-- I just prefer more direct answers apparently.