Fork me on GitHub
#re-frame
<
2017-10-16
>
danielcompton01:10:27

Does anyone use reg-* functions (reg-event-db, e.t.c.) and register anything other than keywords?

hkjels07:10:04

didn’t even know that anything else was supported

cmal10:10:47

Hi, I am using the day8.re-frame.http-fx to make http request, but it keeps telling me Uncaught TypeError: re-find must match against a string. when I trying to make a request.

cmal10:10:30

Here is my code:

(reg-event-fx
 :search-keyword
 (fn [{:keys [db]} [_ word]]
   {:db         db
    :http-xhrio {:method          :get
                 :url             (str "/p/www/stockinfogate/stock/namefinder?keyword=" word)
                 :response-format (ajax/json-response-format {:keywords? true})
                 :on-success      [:search-keyword-success]
                 :on-failure      [:search-keyword-failed]}}))

Bravi10:10:23

@cmal as I remember :url needs to be :uri?

cmal10:10:20

Ohh.. Thanks!

Bravi10:10:43

no problem 🙂

Bravi10:10:54

did it work? 😄 I’m a n00b myself

Bravi10:10:38

but I was playing around with that module the other day and just remembered randomly

cmal10:10:05

Yeah, it works!

Bravi10:10:11

haha nice!

cmal10:10:18

hahaha...

danielneal10:10:24

maybe it's time to uncomment that spec 😄