Fork me on GitHub
#re-frame
<
2016-10-15
>
richiardiandrea02:10:38

I got a re-frame app that in dev works smoothy but with :optimizations :advanced does never enter into the handlers (I tried to put logs in the generated JS), how can it be possible? Any hint on how to debug?

richiardiandrea03:10:19

aaaaaand...of course it was a bug in my code! facepalm facepalm facepalm

shaun-mahood03:10:32

@richiardiandrea: What kind of bug was it that worked in dev but not advanced mode?

richiardiandrea10:10:34

a bug related in my logic and goog.DEBUG 😄

richiardiandrea12:10:17

If a subscription has a parameter and I would like to depend on it using the new :<-, how can I "pass" the parameter to it?

richiardiandrea12:10:05

Sample of parent:

(reg-sub
 :cards-for-table
 (fn cards-for-table [db [_ table-entity]]
   (ui/latest-cards db (:table/id table-entity))))

richiardiandrea12:10:19

the dependency that fails:

(reg-sub
 :sorted-cards-for-table
 :<- [:cards-for-table]
 (fn cards-for-table [cards _]
   ;; sort cards here))

shaun-mahood14:10:08

@richiardiandrea: Oh good - I know I'm going to do something like that the day before I want to ship something, so I appreciate the details. Hopefully I'll remember what part to check first when it happens to me... :)

richiardiandrea14:10:43

@shaun-mahood not problem, yeah it is good to learn from others' bugs 😄 I totally agree, in particular we are not using the -fx part for booting our app and we are trying to avoid executing the sente routing more than once in dev...some logic that I hope I can happily change with the boot..-fx new re-frame stuff 😄

mikethompson19:10:22

@richiardiandrea > If a subscription has a parameter and I would like to depend on it using the new :<-, how can I "pass" the parameter to it? The new sugar only works in the simple case. :<- [:something] you can't do :<- [:something param]

mikethompson19:10:54

You'd have to revert back to the non sugar version and provide a signal function:

(fn [query-v _] 
    (subscribe [:something ....]))

dokeeffe20:10:30

Hi guys, would someone be able to point me in the right direction for using geolocation in re-frame? I’ve found these links: https://gist.github.com/stepankuzmin/2680992 https://gist.github.com/cap10morgan/7493266 but I’m not sure how to translate this re-frame. So far I can get the latitude and longitude to print in the console but I think those results return too late to be put into the db in the event, so on my page they are just nil. My thought is that I need to add a handler to put the results into the db when they return but I’m not sure how to go about that.