Fork me on GitHub
#cljsrn
<
2016-05-29
>
debug03:05:17

The React Native tutorial with vanilla JS works, not sure why this can't make GET requests

debug04:05:32

(def fetch (.-fetch js/window))
(register-handler
  :load-data
  (fn [db _]
    (.then (fetch "") #((.warn js/console (.stringify (.-JSON js/window) %1)(dispatch :process-data %1))))))

debug04:05:45

This works though

debug04:05:03

But the UI becomes unresponsive

misha05:05:09

guys, can anyone explain to me why these 2 implemented as macros, not as functions?

(ns natal-shell.data-source)

(defmacro data-source [config]
  `(js/React.ListView.DataSource. (cljs.core/clj->js ~config)))

(defmacro clone-with-rows [ds rows]
  `(.cloneWithRows ~ds (cljs.core/clj->js ~rows)))

pesterhazy08:05:05

@misha, not a re-natal developer, but these look like should be rewritten as simple functions

pesterhazy09:05:06

@debug, now what you mention it, I saw a similar issue when porting my code to Android, and also ended up using js/fetch directly

pesterhazy09:05:42

why is https://github.com/facebook/react-native/issues/3115 closed? is it solved in recent RN versions?

pesterhazy09:05:00

anyway we should get this fixed, either in RN/android or in cljs-ajax

debug13:05:52

Yeah, wondering the same

debug13:05:03

It's been there for quite a while

kenny23:05:05

Hi. I seem to be getting undefined is not a function (evaluating myns.core.main()). I am using boot-react-native. Any ideas on what might be causing this? My main function is ^:exported.