Fork me on GitHub
#re-frame
<
2022-02-25
>
ag03:02:09

you can't dispatch fx handler directly, can you?

p-himik09:02:30

That is correct.

👍 1
craftybones15:02:52

What kind of OAuth flows do most of you use along with `re-frame`  ?

craftybones15:02:41

Are there any libraries/patterns that you’d recommend?

pip23:02:52

does anyone have an example of a larger reframe app where the events are split up into multiple namespaces?

pip23:02:12

looking for a reason why my event handlers aren’t being registered properly

p-himik23:02:27

An external example is likely to confound things further for you. If you don't know what to do anymore, make sure you're using Git or something else, and start basically creating a minimal reproducible example by removing parts of your code. It'll likely result in a better understanding of what's going on and will help you fix the issue. The most likely cause is that you register events in some namespace that you never require anywhere.

pip23:02:02

cool — i registered events and then required the namespace in my views file

pip23:02:46

if you have an example of a panelled setup where there’s more than one events.cljs that would help a alot

p-himik23:02:46

I have this list in my notes, maybe it'll be helpful, although, as I said, I honestly doubt it > Big and/or complete projects that use re-frame > > https://github.com/status-im/status-react > https://github.com/jacekschae/conduit > https://github.com/JoelSanchez/ventas > https://github.com/district0x > Namely, https://github.com/district0x/memefactory and https://github.com/district0x/name-bazaar > https://github.com/lipas-liikuntapaikat/lipas > https://github.com/burkaydurdu/mock-ui I myself usually split namespaces into functionalities and not views/events/subs. So some panel X would get a single namespace or a collection of internal namespaces and one "core" namespace that the rest of the system uses. I've tried the views/events/subs approach before - it just makes things both more complex and more complicated without any gains.

pip11:03:20

ah thank you! what are the main complications?

pip11:03:44

it actually did help

p-himik11:03:16

Splitting events from views from subs just because they are what they are and not because of what their meaning is is akin to separating / from * because those are different operations instead of keeping them together because they're both arithmetical operations. Apart from that semantic issue, you also will have to make sure that you have required the events and the subs namespaces - otherwise, they won't be registered. The navigation becomes much harder. Instead of keeping reasonably sizes pieces of functionality in a single file and navigate just that file, you'll have to think about splitting things into at least 3 files and keep switching between them. Even if your IDE has perfect integration with re-frame (which might easily break if you, say, introduce a wrapper for reg-sub and whatnot), it's still additional steps and/or cognitive load. Navigating to a specific panel code becomes harder. Instead of navigating to my_panel.cljs, you now have to type my_panel/events.cljs or some short version of it - always thinking about which particular kind you want to navigate to, always having to specify it. Those were all downsides. Here's the list of upsides: ().

😂 1
❤️ 1