Fork me on GitHub

@kauko: the last four files in (db, subs, views, and handlers cljs files) are something that I referred to regularly the first couple of weeks doing re-frame until I internalized the patterns. Maybe it'd be helpful to you and to others to condense that example into a single cljs file?

lewix03:05:55 What's going on at line 5 [db ] , something is being ignored ''(does it have to). what is being ignored? | what's going on at line 11- what's path for?is it related to


example of reframe


Lines 4 to 6 are the definition of an anonymous function. If I write it this way, it might not seem so mysterious (fn [db _] (merge db initial-state))


So line 5 is just the args part of that definition


Line 11 is where you can optionally add middleware to registration of a handler.


path is middleware


mikethompson: I got that part


mikethompson: I know what a function is 🙂. If I understand correctly it's expecting two args and one is being ignored. correct? (I was wondering which part of is being ignored and why does it expect two)


Sorry, but your message above got a bit garbled


Every event handler takes two parameters


db and the event


If you don't care about the event then just put in a _


mikethompson: sorry for ealier; I definitely didn't phrase it well enough. thanks


mikethompson: can you link me to the part of the source code that expect two args


mikethompson: I'm not sure I understand the description of path on the link above - what does it say in english for 8 years old


There's lots of docs in the Wiki, can I ask you read them rather than asking for individual tutoring


mikethompson: no need to be rude; not everybody is aware of the wiki /not everybody lives in your world, would have been more polite to point me to the wiki initially


asking for help is asking for individual tutoring? ridiculoous


Right. I spend 5 minutes answering your (garbled) question, and then explaining, and then giving pointers. This 5mins on top of previous help. And what you give back is abuse wrapped in a strawman argument. One certainly needs a thick skin when providing free help. 🙂


In other news, there was a wonderful talk about Re-frame at the clojure remote conference, and this talk was released about a week ago:


@fasiha: Yeah, those look like something I'd come back to quite often. Something like that, a quick reference, is something I miss from the otherwise outstanding readme 🙂


Hmm, actually I wonder if there's something like that in the wiki?


@mikethompson: don't be put off by that guy. I think you're a super helpful guy, and you do a great job at explaining things to people and pointing them in the right direction. I saw absolutely no reason for that guy to get annoyed at you.


He left the channel by the way, I don't know if you have join/leave notifications on or not


Hmm, it did take me a bit to realize that subs & handlers can both be parameterized, which is why register-sub/register-handler take two args, and the destructuring in both cases took me some puzzling (for subs, I never look at the second argument; for handlers, I always do, but I ignore the first element of the second arg—as I imagine most people do).


Re-frame makes so much sense but it does have a few moving parts that all have to be mastered before the full picture clicks into place.


@mikethompson: I too am astonished at the thoughtfulness and thoroughness with which you address questions (and everyone else on this channel too—I maybe expect random strangers to sometimes help me on the web, but never had the experience of the library author doing so much :P)


I’m having trouble with :should-component-update, I don’t know if it is RN specific but it never triggers. I’ve followed: but with no luck, other lc methods like :component-will-update works though.


@mikethompson: thank you for being very helpful to everyone. You are doing a great job.


We also need to be very thoughtful about how we ask for help.