Fork me on GitHub
#reagent
<
2018-08-31
>
onetom03:08:16

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.

onetom03:08:41

(i only have experience with http://hoplon.io 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)

gadfly36103:08:32

@onetom I have experience with both vanilla reagent and re-frame .. the arguments for re-frame can be found here: https://github.com/Day8/re-frame/blob/master/docs/FAQs/DoINeedReFrame.md

gadfly36103:08:06

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

gadfly36103:08:29

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)

onetom03:08:14

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)

onetom03:08:18

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.

mikethompson09:08:39

[: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.

justinlee18:08:03

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

benzap19:08:04

@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?