Fork me on GitHub
#re-frame
<
2016-05-27
>
fasiha01:05:25

@kauko: the last four files in https://github.com/fasiha/zip-code-re-frame/tree/master/src/cljs/zip_code_reframe (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

https://gist.github.com/6ewis/9606ca4933b3d3169b0e2178842aa4a2 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 clojure.zip/path

lewix03:05:09

example of reframe

mikethompson03:05:56

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))

mikethompson03:05:13

So line 5 is just the args part of that definition

mikethompson03:05:39

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

mikethompson03:05:45

path is middleware

lewix03:05:47

mikethompson: I got that part

lewix03:05:23

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)

mikethompson03:05:52

Sorry, but your message above got a bit garbled

mikethompson03:05:28

Every event handler takes two parameters

mikethompson03:05:41

db and the event

mikethompson03:05:56

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

lewix03:05:40

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

lewix03:05:23

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

lewix03:05:44

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

mikethompson03:05:31

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

lewix03:05:28

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

lewix03:05:45

asking for help is asking for individual tutoring? ridiculoous

mikethompson04:05:15

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. 🙂

escherize04:05:37

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: https://www.youtube.com/watch?v=klqorRUPluw

kauko11:05:28

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

kauko11:05:40

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

kauko11:05:19

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

kauko11:05:34

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

fasiha13:05:29

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).

fasiha13:05:18

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.

fasiha13:05:27

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

vikeri14:05:40

I’m having trouble with :should-component-update, I don’t know if it is RN specific but it never triggers. I’ve followed: https://github.com/Day8/re-frame/wiki/Creating-Reagent-Components#form-3-a-class-with-life-cycle-methods but with no luck, other lc methods like :component-will-update works though.

roberto14:05:43

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

roberto14:05:17

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