Created
October 15, 2016 06:35
-
-
Save gabrielnau/6c59bbea1a7ddc8df4de875503d0b942 to your computer and use it in GitHub Desktop.
re-frame-http-fx usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(reg-event-fx | |
:http-request | |
(fn [{:keys [db]} [_ {:keys [method uri on-success on-failure params]}]] | |
{:db db | |
:http-xhrio {:method method | |
:uri uri | |
:params params | |
:on-success on-success | |
:on-failure on-failure | |
:headers {"X-CSRF-Token" csrf-token} | |
:format (ajax/json-request-format) | |
:response-format (ajax/json-response-format {:keywords? true})}})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment