This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-06
Channels
- # babashka-sci-dev (56)
- # beginners (13)
- # biff (3)
- # calva (24)
- # cider (2)
- # clj-together (2)
- # clojure (38)
- # clojure-europe (6)
- # clojure-norway (2)
- # clojurescript (1)
- # cursive (5)
- # introduce-yourself (3)
- # pedestal (4)
- # polylith (5)
- # portal (11)
- # re-frame (7)
- # reitit (6)
- # shadow-cljs (12)
- # spacemacs (5)
- # sql (7)
- # tools-deps (1)
Can I execute events from interceptors? E.g. I want to implement loading spinner with :before (turn it on) and :after (turn it off) interceptor.
The whole interceptor chain is synchronous - you will not see any change in the UI even if you dispatch
from an interceptor.
👍 1
This is probably the most useful document in this case: https://github.com/day8/re-frame/blob/master/docs/Solve-the-CPU-hog-problem.md
👍 1
I'm trying :http-xhrio
with re-frame... It's simple GET request with no params and returns JSON response:
{:http-xhrio {:method :get
:uri ""
:headers {"Content-Type" "application/json"}
:response-format (ajax/json-request-format {:keywords? true})
:on-request [,,,]
:on-success [,,,]
:on-failure [,,,]}}
This request always fails because of parsing, with response:
{:response nil
:last-method "GET"
:original-text "{\"version\":\"2021-11-29-SNAPSHOT\"}"
:last-error ""
:failure :parse
:status-text "Cannot read properties of null (reading 'cljs$core$IFn$_invoke$arity$1') Format should have been "
:status 200
:uri ""
:debug-message "No Error"
:last-error-code 0}
Not sure how to fix this problem, response from the backend seems fine...E.g. this works
(js->clj (.parse js/JSON "{\"version\":\"2021-11-29-SNAPSHOT\"}")
:keywordize-keys true)
;=> {:version "2021-11-29-SNAPSHOT"}