aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/frontend/tau/api.cljs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/frontend/tau/api.cljs b/src/frontend/tau/api.cljs
new file mode 100644
index 0000000..e69bc9c
--- /dev/null
+++ b/src/frontend/tau/api.cljs
@@ -0,0 +1,15 @@
+(ns tau.api
+ (:require
+ [ajax.core :as ajax]))
+
+(defn get-request
+ ([uri on-success on-failure]
+ (get-request uri on-success on-failure {}))
+ ([uri on-success on-failure params]
+ {:http-xhrio {:method :get
+ :uri uri
+ :params params
+ :format (ajax/json-request-format)
+ :response-format (ajax/json-response-format {:keywords? true})
+ :on-success on-success
+ :on-failure on-failure}}))