Fork me on GitHub
#re-frame
<
2019-09-14
>
lepistane09:09:09

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 ?

alekszelark11:09:15

@lepistane what’s wrong with that way?

lepistane11:09:43

nothing i was wondering if there was something more idiomatic like react google maps or something

alekszelark11:09:48

Oh, got it, unfortunately I don’t know, but I’m wondering too.

p-himik14:09:19

@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.

johanatan16:09:11

:dispatch will not work from an effect handler. you must use rf/dispatch as far as I can tell.

p-himik16:09:20

Yeah, sorry - I misread.

johanatan16:09:52

@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 ?

p-himik16:09:58

@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.

johanatan16:09:30

ah, yea, get-handler would probably do the trick.

polymeris18:09:06

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?

polymeris18:09:11

I was thinking just distinguishing the internal ("private") events might help, conventionally prepending - to the kw, for instance ::-foo-success

p-himik18:09:02

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.

👀 4