Fork me on GitHub

@hiskennyness I’ve just used react-bootstrap. It lets you control the component state so it’s fairly trivial to tie into re-frame. Then again I guess baking-soda has a broader range of bootstrap support at this point. I just haven’t taken the leap to try it.


Thanks, all! I just want to get a handle on re-frame, so I think I will pass on modals. Interesting to see Bootstrap in all the suggestions… Hang on, it just occurred to me to check google closure: Any reason CLJS frameworks do not roll that in wherever possible?

Oliver George08:12:11

Lots of the goog ui stuff is quite stateful. That means it's lifecycle can be difficult to map into React components.

Oliver George08:12:15

We tried bootstrap's modal js stuff. It worked but ultimately went for a solution designed for use in react apps.

Oliver George08:12:20

I'm sure everyone ends up with a different solution. We loved blueprintjs for other reasons so used their dialog component too.

Oliver George08:12:15

IMHO dialogs are a pain. If you're getting a handle on re-frame I'd say steer clear and do more typical things.

Oliver George08:12:18

React is for SPAs. SPAs try and make a browser more like an app but rich UI stuff like modal dialogs etc are fiddly in a browser.


Nice! That app diff on event gonna be super useful


How to add a cofx after the "main" handler?


@U2J4FRT2T: you could add them into effects and they should be available for the rest of the interceptor chain.


The problem: I have a function that transform DB into url/path. Then I want to always that DB change, call this to update the url. Where I put it?


Are you trying to set the URL route? Or trying to navigate to another URL that then fires a new event?


Ok, looks like we’re goin’ with the spreadsheet metaphor. Here is Sean Parent on Adobe Adam’s “Property Model”:


Hoplon uses the spreadsheet metaphor quite a bit - there's a lot of conceptual overlap with re-frame there too.


I kind of like it as a metaphor except for the immediate negative reaction based on years of business excel use.


Yes, and indeed I posted to the wrong channel and meant to post to #hoplon (where I had been whining that no one understood me when I used the spreadsheet metaphor — or responded that Excel was buggy <g>).


Well, I'm glad you did - I put that video on my list to watch later. I think the spreadsheet model applies just as well (or just as poorly) to re-frame subscriptions too, so it wasn't that noticeable of a mispost 🙂


Right. I saw the bit of re-frame doc saying roughly “everyone uses the spreadsheet metaphor….” so I felt better. But most people just say, “Why would I want to write a spreadsheet program?“. When enough smart people do that I start looking for a different analogy!


I am playing with todo-mvc and decided to block duplicate todo’s, offering a simple js/alert (via a new :user-error effect) that the todo duplicates ID whatever. That went fine, but the event handler (following the spec) clears the input field after dispatching :add-todo (which, again, I have modified to reject dups). Commonly we allow users to correct mistakes by editing the erroneous value vs forcing a complete retyping. My emerging understanding of re-frame makes me think there is no alternative other than to move the validation into the handler so it knows not to clear. Is there some trick I am missing, or are event handlers where input validation should control app behavior? I guess the trick in this case is that the view needs variable handling based on what happens to the todo, so we need the data to flow to the view (and, yes, I contemplated a “transaction-outcome” property but it struck me as too event-ish for declarative views).


Is there a way to use re-frisk for normal Cljs maps? Basically like an html transformer for maps?


I have some component using react-native-animatable for pulsing text. It pulses fine on the first render, but then doesn't pulse when I change the text. Is there an idiomatic re-frame approach to handling this?

(defn helper-text [message]
  [animatable/text {:animation :bounce
                    :style {:font-size 16
                            :text-align :center
                            :color theme/alternate-text-color}}


Whenever message changes, thus the data returned from helper-text changes, I'd like to kick off the animation.


I suppose this is more of a reagent question, actually. As I haven't found any animation-specific re-frame libraries, the only way re-frame can likely help here is by keeping some extra state around, listening for when the animation finishes, to clear the state, and then determining when it should start again, by setting that state. That's a lot of additional logic on the event side of things though.


More in line with my mental model is [animatable/text {} "foo"] is different from [animatable/text {} "bar"] so it'll mount and render, thus triggering the animation again. Seems like it only mounts once and then just changes the text displayed, which is optimal, but a pain in this instance.


yeah you might be able to trigger it to re-render by derefing ratoms in the right places


It seems more like a use case for form-3 components though


@danielcompton Yep, in the process of cooking up a form-3 now.