使用 cljs-ajax 的异步调用
Async calls with cljs-ajax
cljs-ajax的ajax请求是同步的吗?如果不是,为什么和默认的GET和POSTAPI有区别?
(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)]))
看起来所有函数都是异步的(GET 和 POST 也是如此)。我去 Github 上创建了一个关于此的问题。朱利安·伯奇 (Julian Birch) 在
中做出回应
cljs-ajax的ajax请求是同步的吗?如果不是,为什么和默认的GET和POSTAPI有区别?
(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)]))
看起来所有函数都是异步的(GET 和 POST 也是如此)。我去 Github 上创建了一个关于此的问题。朱利安·伯奇 (Julian Birch) 在
中做出回应