Fork me on GitHub
#re-frame
<
2017-06-28
>
danielcompton02:06:12

@pandeiro yeah that's a common trip up for people

pandeiro18:06:20

danielcompton: this portion of the cljs-ajax README sort of implies that the values for :format are keywords (e.g., :transit is specified as the default value): https://github.com/JulianBirch/cljs-ajax#getpostput

danielcompton21:06:43

I created a PR for https://github.com/JulianBirch/cljs-ajax/pull/161, but there hasn't been a release with it yet

nidu04:06:48

@gregg Thanks! Unfortunately i want label html label to be shown as well.

gadfly36105:06:38

Hey all, if anyone here is familiar with .dirs-local.el I'd appreciate either your thoughts on this ticket, or your help via a PR 🙂 https://github.com/Day8/re-frame-template/issues/49

joshkh13:06:29

when using the :<- dynamic subscription shorthand there's no access to app-db, right?

(reg-sub
  :test-dynamic
  :<- [:another-subscription]
  (fn [dynamic-subscription-vec evt]
    "Where's app-db?"
    true))

nidu14:06:07

@joshkh i suppose it's intentional so you could define subscriptions strictly in terms of other subscriptions so re-frame could efficiently narrow down list of subscriptions to check after every handler update

joshkh14:06:29

i was thinking along the same line, thanks @nidu

dealy16:06:43

Hi, I'm coming up to speed with re-frame. I was curious about making multiple changes to app-db inside a -db or -fx handler. The page I'm reading makes it seem like this is a bad idea and multiple changes should be handled by multiple events. Am I interpreting this correctly?

mattly16:06:50

I'm curious if anyone has made any attempts to automatically graph re-frame subscription relationships?

mattly16:06:35

I have a fairly convoluted component I'm working on and spent the better part of last night diagramming it out in graphviz

mattly16:06:24

it proved useful if tedious to compile, and I was thinking I could write a macro to help with that part

akiroz17:06:58

@dealy If you mean updating multiple keys in the app-db then I think there's nothing wrong with that. I would do something like this:

(reg-event-db
  :update-foo-and-bar
  (fn [db _]
    (-> db
        (assoc :foo 1)
        (assoc :bar 2))))

dealy17:06:20

yes, that is how I was doing it

akiroz17:06:50

Haven't heard of such project but I'd like to see a nice graph of the whole reactive side of re-frame too~ đź‘Ť

nooga19:06:55

https://github.com/Day8/re-frame/blob/master/docs/Subscribing-To-External-Data.md#some-code Shouldn’t there be at least % in the :on-success handler there?

bradleesand19:06:51

not necessarily

bradleesand19:06:04

you could just want to dispatch something without the return value

bradleesand19:06:35

but often, yes, you would use the % to include the return value in the dispatch

nooga19:06:45

yeah, but this code suggests that the handler should put an async query result somewhere into db

nooga19:06:22

Also, my first thought before reading this article would be to write some kind of coeffect, say (query conn "select * from items") that would expose query result to, say :load-items event handler and make it so that the handler just moves the data from the coeffect to db. It’s somewhat the other way round than presented here.

nooga19:06:19

I see that they mention this here: https://github.com/Day8/re-frame/blob/master/docs/Subscribing-To-External-Data.md#the-alternative-approach Do you maybe know of any good examples of the alternative approach?

pandeiro19:06:47

Are you guys thinking of cutting a new release for the cljs 1.9.660 compiler warnings due to reagent? I see it's been addressed upstream

danielcompton21:06:05

@mattly https://clojurians.slack.com/archives/C073DKH9P/p1498668950274812 this is part of https://github.com/Day8/re-frame-trace. It's still pretty green, but it dynamically discovers the relationships in your code as they run, showing you the current subscription tree