Fork me on GitHub

im wondering what are the limitations of reagent. it's unclear for me what problem does the extra complexity (effects and co-effects) in re-frame solves for example.


(i only have experience with and finally i gave in to the react world, but i still would like to keep my tooling as simple as possible, so i can also teach it with confidence)


@onetom I have experience with both vanilla reagent and re-frame .. the arguments for re-frame can be found here:


Personally I prefer and use vanilla reagent because I work mostly solo .. I'd probably use re-frame if I was working with a team though


What I don't like about re-frame (which is very little .. it's great) is that the events are dispatched async by default and support for sync is lacking in my opinion. I find myself trying to reconstruct synchronous behavior on occasion and it isn't ergonomic. That caveat aside, re-frame is great and many people use it and it has a very active / helpful community (with shiny tooling such as 10x and re-frisk)


it is extremely helpful to hear your experience. sounds like i should gain some experience by practicing reagent first and trying to build solutions around what it's lacking, but once it gets messy i should migrate to re-frame or curry (`keechma` somehow didn't feel attractive at first glance)


i usually work in a team but it's good to have a low-overhead tool for solo situations

👍 4
Rachel Westmacott09:08:12

Is there a good way to make an element that grabs focus once rendered?

Rachel Westmacott09:08:00

I tried [:div {:on-load #(...)} ...] but apparently divs don’t get load events.


[:input {:auto-focus true       <---------
         :type "button" 
          :value "Click me!"
          :on-click click_handler]])
@peterwestmacott ^^^

Rachel Westmacott09:08:35

(turns out the hyphen was very important)

Rachel Westmacott09:08:20

TIL: I didn’t know that the HTML attribute was originally camelCased

Rachel Westmacott10:08:36

Given how easily my last problem was solved here, is there an easy way to make an element go away (or at least detect) when nothing inside it has focus?

Rachel Westmacott10:08:23

I’ve tried an :on-blur attribute, but that seems to fire every time focus changes between sub-elements within my element.


@peterwestmacott i’ve used the react-click-outside package before to do something similar


@peterwestmacott I think the typical way around that is to have an overlay to catch mouse clicks. I'm guessing you have a custom dropdown that you want to close when someone is done with it?