This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-15
Channels
- # announcements (3)
- # architecture (1)
- # babashka (52)
- # beginners (228)
- # calva (1)
- # chlorine-clover (31)
- # cider (9)
- # clj-kondo (16)
- # cljs-dev (25)
- # cljsrn (21)
- # clojure (116)
- # clojure-argentina (8)
- # clojure-europe (18)
- # clojure-france (17)
- # clojure-germany (1)
- # clojure-nl (5)
- # clojure-spec (49)
- # clojure-uk (63)
- # clojurescript (59)
- # community-development (14)
- # conjure (89)
- # core-matrix (1)
- # cursive (18)
- # data-science (1)
- # datomic (27)
- # exercism (4)
- # figwheel-main (5)
- # fulcro (38)
- # ghostwheel (8)
- # graalvm (5)
- # hoplon (2)
- # jobs-discuss (17)
- # juxt (1)
- # lambdaisland (5)
- # luminus (1)
- # lumo (9)
- # malli (7)
- # off-topic (32)
- # planck (24)
- # re-frame (14)
- # reagent (14)
- # reitit (14)
- # rum (23)
- # shadow-cljs (80)
- # spacemacs (2)
- # sql (6)
- # unrepl (1)
- # xtdb (2)
I'm having difficulty getting a http request working as a co-effect. Any hints/examples anywhere? Or is the current way to trigger the dispatch in a callback?
@lsenjov you might be interested in https://github.com/Day8/re-frame-http-fx which packages it up for you
I saw that, but that's the effect afterwards, not the co-effect of getting the data in the first place
A coeffect
is about "assembling" data so that an event handler can compute how an event will change the world
So coeffects are a representation of the world as it is now - the moment the event happened.
They are about obtaining sufficient information from the world, so the event handler can do its computations
When you do an HTTP GET, that is an effect.
It probably arises from the user hitting a button or something
The event handler, on getting the event "user hit button" will want to initiate the HTTP GET ... that's the effect of the event
Summary: you don't do HTTP GETs in coeffects. They happen in effects.