Fork me on GitHub

Can subscriptions have logic in them and query the data from the app db, or should the event set all the properties my view needs and just have simple subscription with no logic?


Yeah - it's totally fine (even recommended) to have logic in the subscriptions. They are cached. One point to watch out for is to separate out "layer-1" subscriptions which just extract from the db and "layer-2" subscriptions which take "layer-1" subscriptions as input and do (possibly more expensive) calculations with them


^ I might have got my layer numbers wrong but that's the basic idea


Thanks, I had no idea subscriptions worked this way. :thumbsup:


I have a question about the best practices around the events.cljs — all my events are currently in that file, 250 lines of it… Any opinions on splitting this file up by component or functional areas? Thx!


@genekim as far as i can tell it's a matter of preference, either way will work applied consitently


just watched this talk yesterday I think a lot of it applies in re-frame @genekim


oh, that’s so cool, @jvuillermet! Watched the first five minutes — looks fascinating. And of course, awesome to hear the creator of Elm speak, too!


Thx for opinion, @sandbags — I think it means “full speed ahead” on trying to split the file up. 🙂

aj taylor17:09:38

@genekim I loved reading your book! Awesome to see that you enjoy re-frame as well 🙂


@aj Haha. Thanks for the kind words! And am just blown away at how great re-frame and clojurescript are!


@genekim what are you working on for your first app, are you able to say?


@gjnoonan It’s a rewrite of It’s one of my most used apps, especially at conferences, which allow me to take notes and tweet at the same time, which turns out to be surprisingly useful for writing books. (Makes note-taking more fun, and allows me to save and find all my notes later.) Original version we did in Objective-C, about 2000 lines of code. TypeScript/React port was about 1000 lines of code. CLJS/re-frame port is probably half that again (not yet running in production, but soon! 🙂 Biggest difference: things I’ve wanted to add to TypeScript version just sat for months, because the code I wrote is such a mess… In contrast, everything seems so easy to implement in ClojureScript/re-frame!


That does seem like a useful app!


I have to touch some TypeScript codebases on occasion, so I know exactly what you mean 🙂


(PS: to be clear, TypeScript is so much safer for me than JavaScript, because I’m such a lousy programmer. It’d be infinitely worse without TypeScript, static type checking, etc… :) @gjnoonan


@genekim Ha I get that, I am a fan of typed languages and the benefits a compiler and type system bring, I think TS is better than JS--and for large codebases and onboarding new team members it is good. It's jut my heart is In Clojure/ClojureScript (hence why I created this community) and I find it hard to write anything else without yearning for them 😆


has anybody here used sodium?


trying to get past the install and I'm getting hung up on java.lang.ExceptionInInitializerError, compiling:(sodium/macros.clj:1:1)