feat(frontend): initial work on react and rumext upgrade

This commit is contained in:
Andrey Antukh 2019-06-19 00:18:52 +02:00
parent ff00bdb3eb
commit 88f45fb618
33 changed files with 184 additions and 144 deletions

View file

@ -154,6 +154,31 @@
[]
(partition 2 params))))
;; (defn normalize-attrs
;; [m]
;; (letfn [(transform [[k v]]
;; (cond
;; (or (= k :class) (= k :class-name))
;; ["className" v]
;; (or (keyword? k) (string? k))
;; [(str/camel (name k)) v]
;; :else
;; [k v]))
;; (walker [x]
;; (if (map? x)
;; (into {} (map tf) x)
;; x))]
;; (walk/postwalk walker m)))
(defn normalize-props
[props]
(clj->js props :keyword-fn (fn [key]
(if (or (= key :class) (= key :class-name))
"className"
(str/camel (name key))))))
;; (defmacro mirror-map [& fields]
;; (let [keys# (map #(keyword (name %)) fields)

View file

@ -59,10 +59,10 @@
(.toString uri)))
(defn- fetch
[{:keys [method url query-string query-params headers body] :as request}
[{:keys [method url query-string query headers body] :as request}
{:keys [timeout credentials? response-type]
:or {timeout 0 credentials? false response-type :text}}]
(let [uri (create-url url query-string query-params)
(let [uri (create-url url query-string query)
headers (if headers (clj->js headers) #js {})
method (translate-method method)
xhr (doto (XhrIo.)