Fork me on GitHub
#re-frame
<
2015-10-15
>
Tom H.09:10:33

@gadfly361: I'm starting to implement a similar pattern. In which file do you require files like src/my-app/component1/handlers.cljs? In the view file?

Tom H.09:10:00

by 'view file' I mean src/my-app/component1/view.cljs

nowprovision10:10:18

its probably the easiest way, i thought about an alternative ns macro, or doing something clever with iterating directories and requiring them, but then you're liking to break tooling like figwheel (figuring out dependency chain)

nowprovision10:10:07

the other alternative is a root handlers.clj which requires only functions from various components and does the registration at the top level

nowprovision10:10:39

i.e. src/my-app/component1/handlers has the function for handling but register-handler is only in handlers.clj

Tom H.13:10:40

@nowprovision actually I really like your last idea. My app is small enough that a root handlers.cljs could contain all the (register-handler) calls but I want to start splitting up some logic

gadfly36115:10:17

@tomisme dunno of it's a good pattern, but i think i was putting em in core.cljs