You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to use the promesa library with cljs-ajax. I am unsure how to resolve / reject a promise in conjunction with the requests generated from that library.
Is this something that you have any experience with?
I am attempting to do something similar to the following.
(let [result (register-user {:username"foo":password"bar"})]
(p/then result #(.log js/console "Success:" %))
(p/catch result #(.error js/console "Error:" %)))
Or inclusive you can use the monadic binding using cats:
(require '[cats.core :as m])
(m/mlet [result (register-user {:username"foo":password"bar"})]
;; The mlet body will be executed only if the;; result will successfully resolved.
(.log js/console "Success " result))
I am attempting to use the promesa library with cljs-ajax. I am unsure how to resolve / reject a promise in conjunction with the requests generated from that library.
Is this something that you have any experience with?
I am attempting to do something similar to the following.
The text was updated successfully, but these errors were encountered: