diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-20 00:46:13 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2022-12-20 00:55:09 +0100 |
commit | d85306e3fa2a25bcace91565bbc9bfabd8e3796c (patch) | |
tree | 0b3640ff5d95a774ea702d36a92030d64492c195 /src/frontend/tau | |
parent | 0dd14a00d40ddb3426f2222e57f141c30a273238 (diff) |
feat: Add request helper for re-frame-http-fx
Diffstat (limited to 'src/frontend/tau')
-rw-r--r-- | src/frontend/tau/api.cljs | 15 |
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}})) |