0
是否cljs-ajax的ajax-request同步?如果没有,为什么它和默认的GET和POST API有区别?使用cljs-ajax进行异步调用
(defn submit [state]
(let [request {
:uri "/new-posting"
:method :post
:params (clj->js @state)
:handler #(js/alert %)
:format :json
:response-format :json
}
response (ajax-request request)]))
它是异步的。你可以阅读这里的区别https://github.com/JulianBirch/cljs-ajax#ajax-request – mavbozo