Fork me on GitHub
#re-frame
<
2016-09-20
>
johanatan00:09:38

@nikp I already have pretty much the exact same [in concept] setup 🙂

johanatan00:09:12

[different names of course]

nikp00:09:16

haha. I feel that after you start working re-frame for a bit it's inevitable to have functions like that

nikp00:09:26

otherwise you just end up with super repetitive/long subs/handlers files

fasiha00:09:06

@shaun-mahood since assoc takes multiple key-val pairs, couldn’t you just do :db (assoc db :foo 42 :bar 1)?

johanatan04:09:06

@nikp yep, although for me after working with re-frame for a while I realized that subscriptions and handlers were overkill for most things I'm doing and instead just use reagent/cursors.

johanatan04:09:22

[and ratom/reactions if I need derived 'events']

nilrecurring06:09:34

I finally took some time to update projects to 0.8 new apis...I'm loving the new abstractions, they feel so natural ❤️

nilrecurring06:09:13

@mikethompson what do you think about some more sugar over basic subs? E.g.

(reg-basic-sub :active-page)
;; Equivalent to
(reg-basic-sub :active-page :active-page)
;; Equivalent to
(reg-sub
    :active-page
    (fn [db [_ k]]
        (k db)))

nilrecurring06:09:40

I just checked out the reframe-utils minilib a couple of messages up there ^

mikethompson07:09:37

Not keen that it be added to re-frame itself, but can obviously be made available via a utils library

nilrecurring07:09:24

Yep, my point was exactly about avoiding another dependency 🙂

mikethompson07:09:56

@andre Hey that looks great. "re-frisk" I'm feeling slightly cautious about googling for that. Some images can't be unseen 🙂

andre07:09:52

@mikethompson thanks, so do you think i should think about better name?

mikethompson07:09:12

No, i think it is great. Just joking about.

andre07:09:19

ok, thanks

mikethompson07:09:21

So, using data-frisk underneath?

mikethompson07:09:02

And that reg-view macro must inspect the view and pluck out the subscriptions

andre07:09:19

Not quite what I wanted, but for the first version i think ok

andre07:09:28

exactly, the code is pretty easy, I'm in progress in github and clojars

mikethompson07:09:02

Certainly proves the concept

mikethompson07:09:37

The challenges will come in bigger applications where there is an overwhelming number of views (many not showing currently)

mikethompson07:09:50

But this is well worth persuing

mikethompson08:09:28

For the longest time I've wanted to "turn debugging re-frame into a data visualization problem"

andre08:09:59

i'm dreaming about visualization of data flow

andre08:09:04

in re-frame

andre08:09:19

how data flowing and changing 🙂

andre08:09:42

views "registered" only then rendered, so, (not showing currently) will not shoung in re-frisk

mikethompson08:09:42

Explains the 4 dominoes of flow

mikethompson08:09:38

Oh, I see. So it is showing a pruned tree of views

mikethompson08:09:30

Let me ask that again for clairty: So only those views currently rendered are in data frisk explorer?

andre08:09:20

unfortunately not, they added then rendered, but stayed after unmount, i think about removing it from explorer after unmount.

andre08:09:20

i didn't see the debugging page, i don't know why 😞 is this something like my lib but using clj-devtools ?

mikethompson08:09:41

No, not really. Same ballpark, but different.

mikethompson08:09:29

But, given you mentioned "flow" it seemed like somethin you might be interested in

mikethompson08:09:07

I have to go and jump on a plane

andre08:09:06

Have a nice flight, thank you