This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-14
Channels
- # announcements (1)
- # beginners (85)
- # calva (23)
- # cider (3)
- # clj-kondo (33)
- # cljs-dev (12)
- # clojure (79)
- # clojure-dev (5)
- # clojure-europe (1)
- # clojure-nl (3)
- # clojure-uk (3)
- # clojurescript (5)
- # clojutre (2)
- # data-science (30)
- # datomic (3)
- # duct (7)
- # fulcro (8)
- # garden (18)
- # jackdaw (2)
- # leiningen (1)
- # off-topic (3)
- # pathom (4)
- # qa (24)
- # re-frame (13)
- # reagent (3)
- # shadow-cljs (58)
- # testing (1)
does anyone use google maps here? i've followed something like https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/google-maps but i am wondering if there is better way to do this ?
@lepistane what’s wrong with that way?
nothing i was wondering if there was something more idiomatic like react google maps or something
@johanatan Just make sure you actually use the :dispatch
effect or one of its varieties. Don't call the dispatch
function in your event handlers.
:dispatch
will not work from an effect handler. you must use rf/dispatch
as far as I can tell.
@p-himik yes, that is what i did from the event handler. but what can one do from an effect handler to invoke another effect without an additional intermediary event ? is there anything ?
@johanatan Sure. AFAIK you can safely use the dispatch
function in effect handlers. Or even just call the required effect handler function directly. Check out re-frame.registrar/get-handler
.
I am having trouble keeping my event-spaghetti untangled. Typically in a ns, I'll have a few "entrypoint" events, like ::foo
, that will do some async -fx
thing, and upon which it will dispatch ::foo-success
or ::foo-failure
, but often the event chain will be longer or have more branches. Any tips?
I was thinking just distinguishing the internal ("private") events might help, conventionally prepending -
to the kw, for instance ::-foo-success
I'm doing just that. And all of the events are grouped by their domain in their corresponding files. Also maybe https://github.com/Guaranteed-Rate/re-flow or https://github.com/ingesolvoll/re-chain could be useful here.