zackteo 2021-06-12T09:12:01.103500Z

May I ask what is a simple way for me to view the contents of my :db ?

p-himik 2021-06-12T09:14:20.103800Z

re-frame-10x or re-frisk

zackteo 2021-06-12T09:15:31.104Z

How do I access the value actually? Or must it be through a subscription?

p-himik 2021-06-12T09:17:25.104200Z

With those tools - they do it for you. On your own - a public API would be to use a sub or an event handler. A private API would be @re-frame.db/app-db.

zackteo 2021-06-12T09:33:18.104400Z

Okay! Btw do you happen to know if I need to include [re-frame/tracing] for re-frame 10x? Seems like it has been replaced by re-frame-debux

p-himik 2021-06-12T09:36:19.104600Z

Just follow the guide in the README.

zackteo 2021-06-12T09:37:34.104800Z

Whoops yeah was confused for a moment, but found the explanation on that after including re-frame-10x on its own!

p-himik 2021-06-12T09:37:53.105Z

Also, debux readme mentions: > still a work in progress and there'll likely be little annoyances and bugs, perhaps even big ones


I'm going through the re-frame docs for getting data from servers using I have my reg-event-fx like below:

 (fn [{:keys [db]} _]
   {:http-xhrio {:method          :get
                 :uri             "<>"
                 :format          (ajax/json-request-format)
                 :response-format (ajax/json-request-format {:keywords? true})
                 :on-success      [:process]
                 :on-failure      [:fail]}
    :db db}))
My success handler:
 (fn [db [_ data]]
   (js/console.log "here: " data)
   (assoc db :bar (:status-text data))))
My fail handler:
 (fn [db [_ bad]]
   (js/console.log "fail :(" bad)
   (assoc db :bar (:status-text bad))))
It ALWAYS goes into fail handler with the error:
Cannot read property 'cljs$core$IFn$_invoke$arity$1' of null Format should have been
I have no idea what that error is meant to be telling me: Here's what it looks like in the browser console: It's fetching the json OK. Anyone any idea what the error means?

p-himik 2021-06-12T21:41:59.107500Z

Both of your formats use json-request-format function. One of them should be a response format, IIRC.


aaaaaaaaaaaaargh! you are correct, i never noticed that


thank you.


I've been looking at that code for 30 mins now, trying to see whats wrong. You spot it immediately sigh

p-himik 2021-06-12T21:56:26.108300Z

Well, the error does hint at it with its "Format should have been". :)