This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-11
Channels
- # asami (19)
- # babashka (41)
- # beginners (115)
- # biff (7)
- # calva (78)
- # clj-kondo (29)
- # cljs-dev (9)
- # clojure (39)
- # clojure-europe (17)
- # clojure-gamedev (29)
- # clojure-nl (1)
- # clojure-norway (9)
- # clojure-spec (2)
- # clojure-uk (3)
- # clojurescript (7)
- # core-async (26)
- # cursive (16)
- # datomic (13)
- # emacs (1)
- # events (5)
- # fulcro (2)
- # funcool (4)
- # gratitude (1)
- # helix (1)
- # holy-lambda (1)
- # humbleui (1)
- # introduce-yourself (4)
- # java (1)
- # jobs (2)
- # jobs-discuss (9)
- # lsp (28)
- # matcher-combinators (2)
- # mathematics (1)
- # membrane (1)
- # nbb (12)
- # off-topic (10)
- # pathom (52)
- # polylith (38)
- # portal (32)
- # re-frame (4)
- # reagent (16)
- # reitit (2)
- # remote-jobs (1)
- # reveal (1)
- # rewrite-clj (10)
- # sci (67)
- # shadow-cljs (45)
- # squint (1)
- # tools-build (13)
- # tools-deps (16)
Hi This could be in the weeds a bit, but I am reading the documentation and arrived at the https://day8.github.io/re-frame/Talking-To-Servers/#version-1. It gives an example Version 1
which makes an ajax request then dispatches events based on the response. I agree the event handler isn't pure. The documentation-suggested way to make this request is to leverage reg-event-fx
to return a series of effects one of which is the :http-xhrio
effect. https://github.com/day8/re-frame-http-fx/blob/master/src/day8/re_frame/http_fx.cljs#L98 this is just an effect handler. I understand that the Version 2
example is now using an "effect" instead of an event handler. However, I don't understand what makes invoking the effect handler "pure" when it still is eventually - somewhere - doing the ajax request. What is the differentiator between the two that allows using a req-event-fx
handler performing a side effect to be "pure"?