-
-
Save danielneal/efd8e6d9e4151a0d7f200aae0ce28a18 to your computer and use it in GitHub Desktop.
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
(rf/reg-fx | |
:POST | |
;; on-success is a reframe event vector [:foo/bar ...] | |
(fn [{:keys [url params on-success on-fail]}] | |
(take! (http/post url {:form-params params}) | |
;; conj the results into it so the response gets put into the event | |
;; like this: | |
;; [:foo/bar <result>] | |
#(re-frame.core/dispatch (conj on-success %))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment