re-frame

https://github.com/Day8/re-frame/blob/master/docs/README.md https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
2020-08-16T02:16:24.377200Z

@marcus.akre be careful with that approach. See the FAQ entry on Laggy Inputs

Marcus 2020-08-16T08:56:58.379100Z

@mikethompson Ah thanks! Didn't know that would be a problem. One of the proposed solutions is to switch to use dispatch-sync. I guess that could work if it is not used too much.

Casey 2020-08-16T14:31:01.380700Z

All the examples and small projects I've seen tend to group events, subs, and fx in one file... or one file for events, one for subs, etc. How do real-world larger projects handle this? I can see on events ns getting really huge

p-himik 2020-08-16T14:33:09.380800Z

Initially, I split into files that deal with a single "piece" of the app, however you define it. When one such file becomes unwieldy, I split it into smaller chunks. Usually a file per component. So I might start with something like main_page.cljs and end up with something like login_form.cljs, navbar.cljs, items_table.cljs, and so on.

Casey 2020-08-16T16:25:09.381Z

Do you group -db , -event-fx, -fx and, -subs together by "piece"/ "action" or by type (e.g., all subs together, all fx together, etc)?

p-himik 2020-08-16T16:31:50.381200Z

Nope, I don't see the point of grouping by these things. Otherwise, it would also make sense to group def and defn separately, and we don't do that. Also, suppose you have a sub like :app/my-value. And you have an event :app/set-my-value. Why would you ever split them? Unless you want to have to change multiple sources if you ever decide to change how the value is actually stored.

2020-08-16T16:40:00.381400Z

I use a hybrid approach: separate, top-level namespaces for subs, events and db for things that are global/application-wide, and then individual namespaces for specific components, with db, subs, and event handlers as sections within the namespace.

p-himik 2020-08-16T16:41:08.381600Z

Oh, right - I use top-level nss as well for some things.